Closed m4dh0rs3 closed 7 months ago
Closing, as I believe this should be fixed at Relm4 by upgrading gtk4, not at this template.
This is actually a bug in the template. If you close a GTK window, it gets destroyed by default unless you set connect_close_request()
and just hide the window from there. The problem is that the variable still exists, which makes it very easy in Relm4 to reopen the already destroyed window. I actually contributed the warning message with "A window is shown after it has been destroyed..." to GTK to help (Relm4) developers spot this mistake.
To fix this, either the dialog must be recreated every time or the close-request signal must be intercepted to prevent the window from being destroyed and leaving it in an inconsistent state.
I fixed this by setting .set_hide_on_close(true);
on my AboutWindow
for now.
I fixed this by setting .set_hide_on_close(true); on my AboutWindow for now.
This is a good solution. As I said, you just need to prevent to window from being destroyed on close, which the "hide-on-close" property prevents. If you want, you could send a PR with the same change here :)
It should be fixed now with the latest commits.
Opening the
AboutDialog
a second time after closing "will leave the window in an inconsistent state" GTK warns. I myself can't close theAboutDialog
anymore, I will have to kill the app.This happens on both profiles. Run with GNOME Builder. Does not happen with gtk-rust-template.
Reproduce:
Maybe related to gtk4-rs#1544, fixed in
0.8.0
, which Relm4 has not updated to yet.