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 703540 - hiding a PanelMenuButton does not close its menu
hiding a PanelMenuButton does not close its menu
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
3.8.x
Other Linux
: Normal enhancement
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2013-07-03 13:01 UTC by Simon McVittie
Modified: 2013-07-11 15:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
panelMenu: Close menu when hiding the corresponding button (1.58 KB, patch)
2013-07-03 14:09 UTC, Florian Müllner
committed Details | Review

Description Simon McVittie 2013-07-03 13:01:31 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).
Comment 1 Florian Müllner 2013-07-03 14:09:51 UTC
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 ...
Comment 2 drago01 2013-07-03 14:19:31 UTC
Review of attachment 248313 [details] [review]:

OK.
Comment 3 Florian Müllner 2013-07-11 15:27:53 UTC
Attachment 248313 [details] pushed as dabcd29 - panelMenu: Close menu when hiding the corresponding button