After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 789927 - popup menu leaves behind broken app when the window it's attached to closes
popup menu leaves behind broken app when the window it's attached to closes
Product: gtk+
Classification: Platform
Component: Widget: GtkMenu
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Depends on:
Reported: 2017-11-05 09:35 UTC by Christian Persch
Modified: 2018-05-02 19:25 UTC
See Also:
GNOME target: ---
GNOME version: ---

Description Christian Persch 2017-11-05 09:35:46 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.
Comment 1 GNOME Infrastructure Team 2018-05-02 19:25:43 UTC
-- 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: