popover: Fix reentrancy problem
Calling popover.show() returns control to the main loop, but squeekboard structures are still borrowed meanwhile. That's dangerous and forbidden in Rust. Therefore, this forces the return from the stack and release of the borrows before the glib main loop is invoked again.
This commit is contained in:
@ -360,5 +360,8 @@ pub fn show(
|
||||
menu.insert_action_group("popup", Some(&action_group));
|
||||
|
||||
menu.bind_model(Some(&model), Some("popup"));
|
||||
menu.popup();
|
||||
glib::idle_add_local(move || {
|
||||
menu.popup();
|
||||
Continue(false)
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user