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:
Dorota Czaplejewicz
2021-12-09 12:41:58 +00:00
parent 2ac4980db9
commit 81948425d8

View File

@ -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)
});
}