GNOME Bugzilla – Bug 703540
hiding a PanelMenuButton does not close its menu
Last modified: 2013-07-11 15:27:57 UTC
Steps to reproduce: * have some extension that creates a PanelMenuButton (e.g. have DriveMenu from gnome-shell-extensions, and have at least one USB stick plugged in) * while the menu is open, make the PanelMenuButton invisible (e.g. for DriveMenu, "eject" the last remaining USB stick, resulting in a call to DriveMenu.actor.hide(); I've also seen this in an extension that calls hide() on the PanelMenuButton subclass itself) Expected result: * the menu closes Actual result: * the menu remains open, pointing at the blank space on the panel where the PanelMenuButton used to be I suspect this can't be "fixed" in general, but it would be nice if there was at least one "correct" way that did work (at which point DriveMenu should use it).
Created attachment 248313 [details] [review] panelMenu: Close menu when hiding the corresponding button A PanelMenuButton added to the top bar might not be visible at all times. If it is hidden while the corresponding menu is open, we currently don't do anything at all, e.g. the menu remains open pointing to an arbitrary location in the top bar. Instead, close the menu automatically in that case. (In reply to comment #0) > I suspect this can't be "fixed" in general Surely that's possible. An even more general approach would be to hook up 'notify::visible' (and 'destroy'?) directly in PopupMenuManager ...
Review of attachment 248313 [details] [review]: OK.
Attachment 248313 [details] pushed as dabcd29 - panelMenu: Close menu when hiding the corresponding button