GNOME Bugzilla – Bug 789927
popup menu leaves behind broken app when the window it's attached to closes
Last modified: 2018-05-02 19:25:43 UTC
When a GtkMenu is attached to a window (gtk_menu_attach_to_widget), then shown with gtk_menu_popup(), and then after it's shown the window closes (but the app continues to run, for example because it has other windows open), the popup menu becomes a grey square on top of the other windows, and there are loads of Gtk-CRITICAL **: _gtk_widget_captured_event: assertion 'WIDGET_REALIZED_FOR_EVENT (widget, event)' failed warnings on console. You can repro this in gnome-terminal as of commit fd1d562f57f1d0033130a39a5ed49e6d3d6fe133, by opening a 2nd window, typing "sleep 5; exit" into the shell+return, then while it's sleeping right-click to open the context menu. I'm going to workaround this in g-t now, but IMHO, when the widget a menu is attached to is destroyed, the attached menu should automatically be gtk_menu_shell_deactivate()d by gtk+ if it's on-screen at that time.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/969.