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 699272 - Move the message tray menu to the message tray button
Move the message tray menu to the message tray button
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2013-04-29 22:38 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2013-08-19 13:35 UTC
See Also:
GNOME target: 3.10
GNOME version: ---


Attachments
popupMenu: Allow PopupMenuManager to take an existing grab helper (3.40 KB, patch)
2013-04-29 22:38 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
popupMenu: Don't use "grabbed" to determine whether to change menus (1.69 KB, patch)
2013-04-29 22:38 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
messageTray: Move adding the menu actor to MessageTrayContextMenu (1.21 KB, patch)
2013-04-29 22:38 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
messageTray: Use a PopupMenuManager for the message tray context menu (1.96 KB, patch)
2013-04-29 22:38 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
messageTray: Rename the context menu to the tray menu (2.66 KB, patch)
2013-04-29 22:38 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review
messageTray: Move the tray menu to a button (5.22 KB, patch)
2013-04-29 22:38 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
messageTray: Move adding the menu actor to MessageTrayContextMenu (1.21 KB, patch)
2013-08-12 14:07 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
messageTray: Use a PopupMenuManager for the message tray context menu (1.91 KB, patch)
2013-08-12 14:07 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
messageTray: Rename the context menu to the tray menu (2.63 KB, patch)
2013-08-12 14:07 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
messageTray: Move the tray menu to a button (6.45 KB, patch)
2013-08-12 14:07 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
messageTray: Move the tray menu to a button (6.20 KB, patch)
2013-08-13 17:04 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
grabHelper: Introduce a stack of grab helpers (3.28 KB, patch)
2013-08-17 00:13 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
messageTray: Move the tray menu to a button (6.06 KB, patch)
2013-08-17 00:13 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2013-04-29 22:38:11 UTC
See patches. This implements the design seen in:

https://live.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/#Wireframes

This is a preliminary patch stack, of sorts. It does not contain
support for the Notifications or Chat switches yet, as it's unknown
what they will do.

Review and feedback appreciated.
Comment 1 Jasper St. Pierre (not reading bugmail) 2013-04-29 22:38:15 UTC
Created attachment 242859 [details] [review]
popupMenu: Allow PopupMenuManager to take an existing grab helper

We want to use PopupMenuManager for the message tray menu, but in
order to prevent interference with having two GrabHelpers manage
the tray, simply modify PopupMenuManager to allow the existing
GrabHelper used in the message tray.
Comment 2 Jasper St. Pierre (not reading bugmail) 2013-04-29 22:38:18 UTC
Created attachment 242860 [details] [review]
popupMenu: Don't use "grabbed" to determine whether to change menus

If we have an existing non-menu grab on the grab helper, we shouldn't
open a menu when hovering. Make sure that the topmost grab is indeed
a menu.
Comment 3 Jasper St. Pierre (not reading bugmail) 2013-04-29 22:38:21 UTC
Created attachment 242861 [details] [review]
messageTray: Move adding the menu actor to MessageTrayContextMenu

This matches BackgroundMenu and EntryMenu.
Comment 4 Jasper St. Pierre (not reading bugmail) 2013-04-29 22:38:25 UTC
Created attachment 242862 [details] [review]
messageTray: Use a PopupMenuManager for the message tray context menu
Comment 5 Jasper St. Pierre (not reading bugmail) 2013-04-29 22:38:28 UTC
Created attachment 242863 [details] [review]
messageTray: Rename the context menu to the tray menu
Comment 6 Jasper St. Pierre (not reading bugmail) 2013-04-29 22:38:31 UTC
Created attachment 242864 [details] [review]
messageTray: Move the tray menu to a button
Comment 7 Giovanni Campagna 2013-05-15 16:12:31 UTC
Review of attachment 242859 [details] [review]:

You should at least explain the changes related to .actor and .actor._delegate, or put a comment there.
Comment 8 Giovanni Campagna 2013-05-15 16:14:12 UTC
Review of attachment 242860 [details] [review]:

Ok
Comment 9 Giovanni Campagna 2013-05-15 16:14:13 UTC
Review of attachment 242860 [details] [review]:

Ok
Comment 10 Giovanni Campagna 2013-05-15 16:14:49 UTC
Review of attachment 242861 [details] [review]:

Yes
Comment 11 Giovanni Campagna 2013-05-15 16:14:50 UTC
Review of attachment 242861 [details] [review]:

Yes
Comment 12 Giovanni Campagna 2013-05-15 16:15:16 UTC
Review of attachment 242862 [details] [review]:

Ok
Comment 13 Giovanni Campagna 2013-05-15 16:16:58 UTC
Review of attachment 242862 [details] [review]:

Or maybe not. I think we need a nested grab, to block clicks on sources when the menu is up.
Comment 14 Giovanni Campagna 2013-05-15 16:16:58 UTC
Review of attachment 242862 [details] [review]:

Or maybe not. I think we need a nested grab, to block clicks on sources when the menu is up.
Comment 15 Giovanni Campagna 2013-05-15 16:18:38 UTC
Review of attachment 242863 [details] [review]:

Cosmetic and not necessary, please avoid it.
Comment 16 Giovanni Campagna 2013-05-15 16:20:58 UTC
Review of attachment 242864 [details] [review]:

::: js/ui/messageTray.js
@@ +1581,2 @@
         this.actor.connect('button-release-event', Lang.bind(this, function(actor, event) {
+            this._trayMenu.close(BoxPointer.PopupAnimation.FULL);

This needs to be handled by GrabHelper.

@@ +1719,3 @@
+                                                      track_hover: true,
+                                                      can_focus: true,
+                                                      accessible_name: _("Tray Menu"),

Tray Menu is a bit technical, Chat Menu maybe?
Comment 17 Jasper St. Pierre (not reading bugmail) 2013-08-12 14:07:10 UTC
Created attachment 251372 [details] [review]
messageTray: Move adding the menu actor to MessageTrayContextMenu

This matches BackgroundMenu and EntryMenu.
Comment 18 Jasper St. Pierre (not reading bugmail) 2013-08-12 14:07:14 UTC
Created attachment 251373 [details] [review]
messageTray: Use a PopupMenuManager for the message tray context menu
Comment 19 Jasper St. Pierre (not reading bugmail) 2013-08-12 14:07:17 UTC
Created attachment 251374 [details] [review]
messageTray: Rename the context menu to the tray menu
Comment 20 Jasper St. Pierre (not reading bugmail) 2013-08-12 14:07:22 UTC
Created attachment 251375 [details] [review]
messageTray: Move the tray menu to a button
Comment 21 Ray Strode [halfline] 2013-08-12 21:31:02 UTC
Review of attachment 251372 [details] [review]:

sure
Comment 22 Ray Strode [halfline] 2013-08-12 21:40:24 UTC
Review of attachment 251373 [details] [review]:

looks like a reasonable consolidation of code. Looking I can't spot any immediate functional differences.
Comment 23 Ray Strode [halfline] 2013-08-12 21:43:06 UTC
Review of attachment 251374 [details] [review]:

calling it trayMenu is a little redundant since it's in the messageTray class. I'd probably just call it menu, but whatever!
Comment 24 Jasper St. Pierre (not reading bugmail) 2013-08-13 10:58:02 UTC
(In reply to comment #23)
> calling it trayMenu is a little redundant since it's in the messageTray class.
> I'd probably just call it menu, but whatever!

Well, this and this is sort of weird quirk of the MessageTray code, we have the "notification widget" (which corresponds to banners), and the "tray actor" (which corresponds to the system texture tray).

We use this._trayState and this._traySummoned, etc. to talk about the "tray actor" itself. Due to historical reasons, we have "this.actor" which corresponds to the gray tray (it used to be a container for both), but I'm going to change that in a future cleanup.
Comment 25 Jasper St. Pierre (not reading bugmail) 2013-08-13 15:24:42 UTC
Attachment 251372 [details] pushed as e6ef115 - messageTray: Move adding the menu actor to MessageTrayContextMenu
Attachment 251373 [details] pushed as f5c0706 - messageTray: Use a PopupMenuManager for the message tray context menu
Attachment 251374 [details] pushed as 548111e - messageTray: Rename the context menu to the tray menu
Comment 26 Jasper St. Pierre (not reading bugmail) 2013-08-13 17:04:13 UTC
Created attachment 251526 [details] [review]
messageTray: Move the tray menu to a button

Implements latest designs.
Comment 27 drago01 2013-08-15 19:32:40 UTC
Review of attachment 251526 [details] [review]:

Didn't test because does not apply cleanly and I am to lazy to rebase right now. But code looks good to me modulo magic number.

::: js/ui/messageTray.js
@@ +1822,3 @@
 
+        this._messageTrayMenuButton = new MessageTrayMenuButton(this);
+        this._messageTrayMenuButton.actor.margin_left = 16;

Magic number use a constant.
Comment 28 Jasper St. Pierre (not reading bugmail) 2013-08-17 00:13:10 UTC
Created attachment 251959 [details] [review]
grabHelper: Introduce a stack of grab helpers

GrabHelpers use a 'captured-event' to steal events and emulate
modality or grab-like semantics. There can be issues when you try to
use multiple GrabHelpers stacked on each other. As Clutter follows
the DOM-like semantics of "first come, first serve", when a second
GrabHelper connects to 'captured-event', its callback will only be
processed *after* the first GrabHelper's callback is called.

This breaks the expectation of narrowing modality where new modals
take priority over the old ones.

Solving this globally in a cleaner manner would require a rewrite of
pushModal/GrabHelper. As a stopgap fix for now, use one shared
'captured-event' handler between all GrabHelper instances, and
delegate to the individual GrabHelpers.
Comment 29 Jasper St. Pierre (not reading bugmail) 2013-08-17 00:13:15 UTC
Created attachment 251960 [details] [review]
messageTray: Move the tray menu to a button
Comment 30 Matthias Clasen 2013-08-18 15:00:18 UTC
we should probably get this landed for the ui freeze
Comment 31 Giovanni Campagna 2013-08-18 15:17:56 UTC
I can confirm that the GrabHelper patch fixes the hover issues with the tray menu.
Also, the available menu items work, which is always good. But, wasn't the design supposed to include a Chat switch?
Comment 32 Giovanni Campagna 2013-08-18 15:20:59 UTC
Review of attachment 251959 [details] [review]:

::: js/ui/grabHelper.js
@@ +15,3 @@
+function _onCapturedEvent(actor, event) {
+    let grabHelper = _grabHelperStack[_grabHelperStack.length - 1];
+    return grabHelper._onCapturedEvent(event);

You're calling it from outside the class, make it public?
Maybe handleCapturedEvent()?

@@ +22,3 @@
+
+    if (_capturedEventId == 0)
+        _capturedEventId = global.stage.connect('captured-event', _onCapturedEvent);

captured-event is also used for wayland event handling (including updating the pointer position on screen).

Are there some ordering guarantees in GObject, or nothing at all?
Because otherwise we need to move away from captured-event entirely
Comment 33 Giovanni Campagna 2013-08-18 15:22:41 UTC
Review of attachment 251960 [details] [review]:

Looks good
Comment 34 Jasper St. Pierre (not reading bugmail) 2013-08-18 18:44:47 UTC
(In reply to comment #32)
> Are there some ordering guarantees in GObject, or nothing at all?
> Because otherwise we need to move away from captured-event entirely

The guarantee is first-come first-serve. If A connects before B, then A gets the signal emission before B.

connect_after and vfunc emission make things more complicated, but if captured-event is always the first signal connected, then it should be guaranteed to be called first.
Comment 35 Jasper St. Pierre (not reading bugmail) 2013-08-19 02:20:08 UTC
(In reply to comment #31)
> Also, the available menu items work, which is always good. But, wasn't the
> design supposed to include a Chat switch?

Since we don't have a Chat app yet, I'm not sure what it would do. You could turn it on, but would turning it off mean `pkill empathy`? Setting telepathy status to offline?
Comment 36 Giovanni Campagna 2013-08-19 07:42:55 UTC
(In reply to comment #35)
> (In reply to comment #31)
> > Also, the available menu items work, which is always good. But, wasn't the
> > design supposed to include a Chat switch?
> 
> Since we don't have a Chat app yet, I'm not sure what it would do. You could
> turn it on, but would turning it off mean `pkill empathy`? Setting telepathy
> status to offline?

Set telepathy to off, and then if empathy doesn't die after the usual 60 seconds timeout it's an empathy bug.
Basically, what the old selector did.
Comment 37 Jasper St. Pierre (not reading bugmail) 2013-08-19 13:35:28 UTC
Attachment 251959 [details] pushed as 8d9aa63 - grabHelper: Introduce a stack of grab helpers
Attachment 251960 [details] pushed as d1a8177 - messageTray: Move the tray menu to a button


Pushed with suggestion changes. Other switches will come soon.