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 702539 - PopupMenu changes and fixes for the aggregate menu
PopupMenu changes and fixes for the aggregate menu
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-06-18 09:25 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2013-07-15 16:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
popupMenu: Introduce a way of closing toplevels from sections (3.90 KB, patch)
2013-06-18 09:25 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
popupMenu: Don't close submenus when activating items (1.09 KB, patch)
2013-06-18 09:25 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
popupMenu: Simplify allocation code (13.12 KB, patch)
2013-06-18 09:26 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
popupMenu: Ignore submenus when getting the column widths (1.74 KB, patch)
2013-06-18 09:26 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
popupMenu: Don't animate submenus closing when closing the menu (2.35 KB, patch)
2013-06-18 09:26 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
popupMenu: Remove connectSubMenuSignals (5.64 KB, patch)
2013-06-18 09:26 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
popupMenu: Emit open-state-changed at the start of animating a submenu (2.35 KB, patch)
2013-06-18 09:26 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
popupMenu: Only allow one submenu to be open at a time (3.30 KB, patch)
2013-06-18 09:26 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
popupMenu: Remove 'sensitive' input param (1.45 KB, patch)
2013-06-18 09:26 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
popupMenu: Propagate sensitivity to menu children (6.33 KB, patch)
2013-06-18 09:26 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
popupMenu: Ensure that submenus are properly hidden when insensitive (1.13 KB, patch)
2013-06-18 09:26 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
popupMenu: Add a simple way to get the toplevel for a submenu / section (2.14 KB, patch)
2013-07-10 22:32 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
popupMenu: Introduce a way of closing toplevels from sections (2.81 KB, patch)
2013-07-10 22:32 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
popupMenu: Don't close submenus when activating items (1.10 KB, patch)
2013-07-10 22:32 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
popupMenu: Simplify allocation code (13.12 KB, patch)
2013-07-10 22:32 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
popupMenu: Properly implement all-spanning actors (5.79 KB, patch)
2013-07-10 22:32 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
popupMenu: Ignore submenus when getting the column widths (1.74 KB, patch)
2013-07-10 22:32 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
popupMenu: Don't animate submenus closing when closing the menu (2.35 KB, patch)
2013-07-10 22:32 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
popupMenu: Remove connectSubMenuSignals (5.61 KB, patch)
2013-07-10 22:32 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
popupMenu: Emit open-state-changed at the start of animating a submenu (2.35 KB, patch)
2013-07-10 22:32 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
popupMenu: Only allow one submenu to be open at a time (1.24 KB, patch)
2013-07-10 22:32 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
popupMenu: Remove 'sensitive' input param (1.45 KB, patch)
2013-07-10 22:32 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
popupMenu: Propagate sensitivity to menu children (5.72 KB, patch)
2013-07-10 22:33 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
popupMenu: Ensure that submenus are properly hidden when insensitive (1.13 KB, patch)
2013-07-10 22:33 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2013-06-18 09:25:50 UTC
Chapter two of my swamp draining, yak shaving adventure.

Some of these are simply basic cleanups, other ones are predecessors
for more important PopupMenu features that are really tied more to
the aggregate menu work and are hard to split out.

Hopefully the rationale is well-explained in each commit.
Comment 1 Jasper St. Pierre (not reading bugmail) 2013-06-18 09:25:54 UTC
Created attachment 247105 [details] [review]
popupMenu: Introduce a way of closing toplevels from sections

As the aggregate menu will be built out of sections from each
of the menus, we need to ensure that activating an item in one
of these sections can close the main menu, even when it is not
a menu item. The new API also needs to be flexible enough to
ensure that animations can be controlled, like the buttons that
lock the screen or launch a new session.

Port the user menu to use this new API as well.
Comment 2 Jasper St. Pierre (not reading bugmail) 2013-06-18 09:25:57 UTC
Created attachment 247106 [details] [review]
popupMenu: Don't close submenus when activating items

It looks ugly to have the menu shrinking and having its insides
flowing around while the menu is fading out of existence...
Comment 3 Jasper St. Pierre (not reading bugmail) 2013-06-18 09:26:00 UTC
Created attachment 247107 [details] [review]
popupMenu: Simplify allocation code

Use ClutterActor.allocate_align_fill() so we don't have to do
this math ourselves. At the same time, clean up the RTL handling
so that it's easier to follow.
Comment 4 Jasper St. Pierre (not reading bugmail) 2013-06-18 09:26:03 UTC
Created attachment 247108 [details] [review]
popupMenu: Ignore submenus when getting the column widths

The new designs don't want these to be aligned the same way.
Comment 5 Jasper St. Pierre (not reading bugmail) 2013-06-18 09:26:07 UTC
Created attachment 247109 [details] [review]
popupMenu: Don't animate submenus closing when closing the menu

It looks distracting.
Comment 6 Jasper St. Pierre (not reading bugmail) 2013-06-18 09:26:10 UTC
Created attachment 247110 [details] [review]
popupMenu: Remove connectSubMenuSignals

The code here is a bit messy, as the signal disconnection is handled
in two different places. Share code in a better, different way.
Comment 7 Jasper St. Pierre (not reading bugmail) 2013-06-18 09:26:13 UTC
Created attachment 247111 [details] [review]
popupMenu: Emit open-state-changed at the start of animating a submenu

Doing it at the end has confusing semantics, especially as there is
this point where isOpen is true, but the corresponding open-state-changed
has not been emitted.
Comment 8 Jasper St. Pierre (not reading bugmail) 2013-06-18 09:26:17 UTC
Created attachment 247112 [details] [review]
popupMenu: Only allow one submenu to be open at a time

When the user opens another submenu, close the first one.
Comment 9 Jasper St. Pierre (not reading bugmail) 2013-06-18 09:26:20 UTC
Created attachment 247113 [details] [review]
popupMenu: Remove 'sensitive' input param

It's hard to implement properly, was broken, and unused. If somebody
really wants it, they can call setSensitive after constructing the item.
Comment 10 Jasper St. Pierre (not reading bugmail) 2013-06-18 09:26:24 UTC
Created attachment 247114 [details] [review]
popupMenu: Propagate sensitivity to menu children

This way, if a parent is insensitive, all children will be, too.
Comment 11 Jasper St. Pierre (not reading bugmail) 2013-06-18 09:26:28 UTC
Created attachment 247115 [details] [review]
popupMenu: Ensure that submenus are properly hidden when insensitive

We don't actually propagate sensitivity information to submenus; we
simply make sure that they can never be open when the parent is
insensitive.
Comment 12 Giovanni Campagna 2013-06-18 18:55:40 UTC
Review of attachment 247105 [details] [review]:

::: js/ui/popupMenu.js
@@ +1029,3 @@
+
+        this.connect('activate', Lang.bind(this, function(self, animate) {
+            this.close(animate);

You should not connect to your own signals, override the function instead.

::: js/ui/userMenu.js
@@ +805,2 @@
     _onLockScreenActivate: function() {
+        this.menu.itemActivated(BoxPointer.PopupAnimation.NONE);

Can we keep close as the public API, and leave itemActivated for internal use?
Comment 13 Giovanni Campagna 2013-06-18 18:58:26 UTC
Review of attachment 247106 [details] [review]:

::: js/ui/popupMenu.js
@@ -761,3 @@
         object._subMenuActivateId = menu.connect('activate', Lang.bind(this, function(animate) {
             this.emit('activate', animate);
-            this.close(animate);

Uhm, in this context, 'this' refers to the parent menu, not the submenu.
(Also, the function declaration seems to be wrong, the emitter argument is missing)
Comment 14 Giovanni Campagna 2013-06-18 19:06:47 UTC
Review of attachment 247107 [details] [review]:

Looks right.
Comment 15 Giovanni Campagna 2013-06-18 19:07:37 UTC
Review of attachment 247108 [details] [review]:

Ok
Comment 16 Giovanni Campagna 2013-06-18 19:09:00 UTC
Review of attachment 247109 [details] [review]:

Isn't this covered by the previous patch?
Please squash.
Comment 17 Giovanni Campagna 2013-06-18 19:10:05 UTC
Review of attachment 247110 [details] [review]:

Ok
Comment 18 Giovanni Campagna 2013-06-18 19:11:28 UTC
Review of attachment 247111 [details] [review]:

Ok
Comment 19 Giovanni Campagna 2013-06-18 19:11:55 UTC
Review of attachment 247112 [details] [review]:

Ok
Comment 20 Giovanni Campagna 2013-06-18 19:12:51 UTC
Review of attachment 247113 [details] [review]:

I don't understand this. What is the problem?
Comment 21 Giovanni Campagna 2013-06-18 19:13:44 UTC
Review of attachment 247114 [details] [review]:

If the parent is insensitive, isn't the menu supposed to be closed, making the sensitivity irrelevant?
Comment 22 Giovanni Campagna 2013-06-18 19:14:28 UTC
Review of attachment 247115 [details] [review]:

Which is kind of what I was saying in my previous review.
Either this or the previous patch are redundant.
Comment 23 Giovanni Campagna 2013-06-18 19:15:32 UTC
In any case, the whole stack gives me the following traces:

(gnome-shell-real:26790): Gjs-WARNING **: JS ERROR: Exception in callback for signal: destroy: Error: No signal connection 7 found
_disconnect@/opt/gnome/share/gjs-1.0/signals.js:74
PopupMenuBase<.addMenuItem/<@/opt/gnome/share/gnome-shell/js/ui/popupMenu.js:886
_emit@/opt/gnome/share/gjs-1.0/signals.js:124
PopupBaseMenuItem<.destroy@/opt/gnome/share/gnome-shell/js/ui/popupMenu.js:160
wrapper@/opt/gnome/share/gjs-1.0/lang.js:213
_parent@/opt/gnome/share/gjs-1.0/lang.js:175
PopupSubMenuMenuItem<.destroy@/opt/gnome/share/gnome-shell/js/ui/popupMenu.js:1378
wrapper@/opt/gnome/share/gjs-1.0/lang.js:213
PopupMenuBase<.removeAll@/opt/gnome/share/gnome-shell/js/ui/popupMenu.js:977
wrapper@/opt/gnome/share/gjs-1.0/lang.js:213
PopupMenuBase<.destroy@/opt/gnome/share/gnome-shell/js/ui/popupMenu.js:990
wrapper@/opt/gnome/share/gjs-1.0/lang.js:213
_parent@/opt/gnome/share/gjs-1.0/lang.js:175
RemoteMenu<.destroy@/opt/gnome/share/gnome-shell/js/ui/remoteMenu.js:197
wrapper@/opt/gnome/share/gjs-1.0/lang.js:213
Button<.setMenu@/opt/gnome/share/gnome-shell/js/ui/panelMenu.js:146
wrapper@/opt/gnome/share/gjs-1.0/lang.js:213
AppMenuButton<._maybeSetMenu@/opt/gnome/share/gnome-shell/js/ui/panel.js:647
wrapper@/opt/gnome/share/gjs-1.0/lang.js:213
AppMenuButton<._sync@/opt/gnome/share/gnome-shell/js/ui/panel.js:616
wrapper@/opt/gnome/share/gjs-1.0/lang.js:213
AppMenuButton<._focusAppChanged@/opt/gnome/share/gnome-shell/js/ui/panel.js:530
wrapper@/opt/gnome/share/gjs-1.0/lang.js:213
activateWindow@/opt/gnome/share/gnome-shell/js/ui/main.js:496
WindowSwitcherPopup<._finish@/opt/gnome/share/gnome-shell/js/ui/altTab.js:400
wrapper@/opt/gnome/share/gjs-1.0/lang.js:213
SwitcherPopup<._keyReleaseEvent@/opt/gnome/share/gnome-shell/js/ui/switcherPopup.js:203
wrapper@/opt/gnome/share/gjs-1.0/lang.js:213

and

_disconnect@/opt/gnome/share/gjs-1.0/signals.js:74
PopupMenuBase<.addMenuItem/<@/opt/gnome/share/gnome-shell/js/ui/popupMenu.js:886
_emit@/opt/gnome/share/gjs-1.0/signals.js:124
PopupBaseMenuItem<.destroy@/opt/gnome/share/gnome-shell/js/ui/popupMenu.js:160
wrapper@/opt/gnome/share/gjs-1.0/lang.js:213
_parent@/opt/gnome/share/gjs-1.0/lang.js:175
PopupSubMenuMenuItem<.destroy@/opt/gnome/share/gnome-shell/js/ui/popupMenu.js:1378
wrapper@/opt/gnome/share/gjs-1.0/lang.js:213
PopupMenuBase<.removeAll@/opt/gnome/share/gnome-shell/js/ui/popupMenu.js:977
wrapper@/opt/gnome/share/gjs-1.0/lang.js:213
NMDevice<._clearSection@/opt/gnome/share/gnome-shell/js/ui/status/network.js:446
wrapper@/opt/gnome/share/gjs-1.0/lang.js:213
_parent@/opt/gnome/share/gjs-1.0/lang.js:175
NMDeviceWireless<._clearSection@/opt/gnome/share/gnome-shell/js/ui/status/network.js:1060
wrapper@/opt/gnome/share/gjs-1.0/lang.js:213
NMDevice<._queueCreateSection@/opt/gnome/share/gnome-shell/js/ui/status/network.js:439
wrapper@/opt/gnome/share/gjs-1.0/lang.js:213
NMDeviceWireless<._onApStrengthChanged@/opt/gnome/share/gnome-shell/js/ui/status/network.js:938
wrapper@/opt/gnome/share/gjs-1.0/lang.js:213
Comment 24 Jasper St. Pierre (not reading bugmail) 2013-06-18 19:20:34 UTC
Review of attachment 247113 [details] [review]:

setSensitive does:

if (this.sensitive == sensitive)
   return;

Given that we set this.sensitive right above we call setSensitive in the constructor, it will always take the shortcut out.

Calling setSensitive from the constructor is also annoying for subclasses that override syncSensitive / setSensitive, as they might want to manipulate actors that haven't been constructed yet.
Comment 25 Jasper St. Pierre (not reading bugmail) 2013-06-18 19:21:30 UTC
(In reply to comment #21)
> If the parent is insensitive, isn't the menu supposed to be closed, making the
> sensitivity irrelevant?

PopupMenuSections also have parents.
Comment 26 Jasper St. Pierre (not reading bugmail) 2013-06-18 19:24:06 UTC
(In reply to comment #12)
> Review of attachment 247105 [details] [review]:
> 
> ::: js/ui/popupMenu.js
> @@ +1029,3 @@
> +
> +        this.connect('activate', Lang.bind(this, function(self, animate) {
> +            this.close(animate);
> 
> You should not connect to your own signals, override the function instead.

What function? Instead of saying this.emit('animate'), do you want me to modify all places where we do that to call this._activate(animate); which is overridden in PopupMenu to close()?

> ::: js/ui/userMenu.js
> @@ +805,2 @@
>      _onLockScreenActivate: function() {
> +        this.menu.itemActivated(BoxPointer.PopupAnimation.NONE);
> 
> Can we keep close as the public API, and leave itemActivated for internal use?

If we call close() on a toplevel, it will propagate down to all children. This would mean that calling close() as a public API to close a toplevel from a child will both propagate up and back down the tree?

Do we want to change those semantics so that close() only propagates up?
Comment 27 Jasper St. Pierre (not reading bugmail) 2013-07-10 22:32:18 UTC
Created attachment 248884 [details] [review]
popupMenu: Add a simple way to get the toplevel for a submenu / section

This will be used to avoid some nasty signal propagation when wanting to
rework how sections / submenus work.
Comment 28 Jasper St. Pierre (not reading bugmail) 2013-07-10 22:32:22 UTC
Created attachment 248885 [details] [review]
popupMenu: Introduce a way of closing toplevels from sections

As the aggregate menu will be built out of sections from each
of the menus, we need to ensure that activating an item in one
of these sections can close the main menu, even when it is not
a menu item. The new API also needs to be flexible enough to
ensure that animations can be controlled, like the buttons that
lock the screen or launch a new session.

Port the user menu to use this new API as well.
Comment 29 Jasper St. Pierre (not reading bugmail) 2013-07-10 22:32:26 UTC
Created attachment 248886 [details] [review]
popupMenu: Don't close submenus when activating items

It looks ugly to have the menu shrinking and having its insides
flowing around while the menu is fading out of existence...
Comment 30 Jasper St. Pierre (not reading bugmail) 2013-07-10 22:32:30 UTC
Created attachment 248887 [details] [review]
popupMenu: Simplify allocation code

Use ClutterActor.allocate_align_fill() so we don't have to do
this math ourselves. At the same time, clean up the RTL handling
so that it's easier to follow.
Comment 31 Jasper St. Pierre (not reading bugmail) 2013-07-10 22:32:34 UTC
Created attachment 248888 [details] [review]
popupMenu: Properly implement all-spanning actors

All-spanning actors do not have columns, so don't stuff their width
in the column. Instead, propagate it manually through the API, making
sure that the menu is never shorter than the greatest spanning actor.
Comment 32 Jasper St. Pierre (not reading bugmail) 2013-07-10 22:32:38 UTC
Created attachment 248889 [details] [review]
popupMenu: Ignore submenus when getting the column widths

The new designs don't want these to be aligned the same way.
Comment 33 Jasper St. Pierre (not reading bugmail) 2013-07-10 22:32:42 UTC
Created attachment 248890 [details] [review]
popupMenu: Don't animate submenus closing when closing the menu

It looks distracting.
Comment 34 Jasper St. Pierre (not reading bugmail) 2013-07-10 22:32:46 UTC
Created attachment 248891 [details] [review]
popupMenu: Remove connectSubMenuSignals

The code here is a bit messy, as the signal disconnection is handled
in two different places. Share code in a better, different way.
Comment 35 Jasper St. Pierre (not reading bugmail) 2013-07-10 22:32:50 UTC
Created attachment 248892 [details] [review]
popupMenu: Emit open-state-changed at the start of animating a submenu

Doing it at the end has confusing semantics, especially as there is
this point where isOpen is true, but the corresponding open-state-changed
has not been emitted.
Comment 36 Jasper St. Pierre (not reading bugmail) 2013-07-10 22:32:54 UTC
Created attachment 248893 [details] [review]
popupMenu: Only allow one submenu to be open at a time

When the user opens another submenu, close the first one.
Comment 37 Jasper St. Pierre (not reading bugmail) 2013-07-10 22:32:59 UTC
Created attachment 248894 [details] [review]
popupMenu: Remove 'sensitive' input param

It's hard to implement properly, was broken, and unused. If somebody
really wants it, they can call setSensitive after constructing the item.
Comment 38 Jasper St. Pierre (not reading bugmail) 2013-07-10 22:33:04 UTC
Created attachment 248895 [details] [review]
popupMenu: Propagate sensitivity to menu children

This way, if a parent is insensitive, all children will be, too.
Comment 39 Jasper St. Pierre (not reading bugmail) 2013-07-10 22:33:09 UTC
Created attachment 248896 [details] [review]
popupMenu: Ensure that submenus are properly hidden when insensitive

We don't actually propagate sensitivity information to submenus; we
simply make sure that they can never be open when the parent is
insensitive.
Comment 40 Giovanni Campagna 2013-07-13 16:07:18 UTC
Review of attachment 248884 [details] [review]:

Yes.
Comment 41 Giovanni Campagna 2013-07-13 16:08:11 UTC
Review of attachment 248885 [details] [review]:

I remember the discussion on IRC, this is ok
Comment 42 Giovanni Campagna 2013-07-13 16:08:30 UTC
Review of attachment 248886 [details] [review]:

Yep
Comment 43 Giovanni Campagna 2013-07-13 16:08:59 UTC
Review of attachment 248887 [details] [review]:

This was already acn, right?
Comment 44 Giovanni Campagna 2013-07-13 16:12:29 UTC
Review of attachment 248888 [details] [review]:

Is this tested with classic mode?
At some point places-menu had problems with stuff not spanning properly

::: js/ui/popupMenu.js
@@ +210,3 @@
             let child = this._children[i];
             let [min, natural] = child.actor.get_preferred_width(-1);
+            if (child.span == -1) {

Can you have more than one children with span == -1? (Does it even make sense?)
And how about the alignment of them? Are they all in the first column?
Comment 45 Giovanni Campagna 2013-07-13 16:13:50 UTC
Review of attachment 248889 [details] [review]:

Ok, but... does this mean that potentially like the dot gets a different size (because for instance in one case it's a check mark and in the other it's a dot), misaligning the label? I don't think we want that.
Comment 46 Giovanni Campagna 2013-07-13 16:15:16 UTC
Review of attachment 248890 [details] [review]:

Don't we stop closing submenus during the closing animation in a previous patch?

(Indeed, my previous review was "squash")
Comment 47 Giovanni Campagna 2013-07-13 16:15:33 UTC
Review of attachment 248891 [details] [review]:

Ok
Comment 48 Giovanni Campagna 2013-07-13 16:17:42 UTC
Review of attachment 248892 [details] [review]:

Open-state-change is also used for syncing the separators (as well as other stuff), so at least in the closing case we probably don't want this.
Or maybe we want a new "animation-finished" signal for that?
Comment 49 Giovanni Campagna 2013-07-13 16:18:00 UTC
Review of attachment 248893 [details] [review]:

OK
Comment 50 Giovanni Campagna 2013-07-13 16:18:15 UTC
Review of attachment 248894 [details] [review]:

Ok
Comment 51 Giovanni Campagna 2013-07-13 16:21:33 UTC
Review of attachment 248895 [details] [review]:

Just a style nit.

::: js/ui/popupMenu.js
@@ +1217,3 @@
+            return false;
+
+        return this.sourceActor._delegate.getSensitive();

The && you use above looks nicer.
Comment 52 Giovanni Campagna 2013-07-13 16:22:31 UTC
Review of attachment 248896 [details] [review]:

::: js/ui/popupMenu.js
@@ +1369,3 @@
+    syncSensitive: function() {
+        let sensitive = this.parent();
+        this._triangle.visible = sensitive;

Do we want to hide the triangle as well?
Is it in the designs?

To me, it doesn't look right: the item is still a submenu item, even if disabled.
Comment 53 Jasper St. Pierre (not reading bugmail) 2013-07-13 16:35:06 UTC
Review of attachment 248889 [details] [review]:

The design is manually allocated to just be inside the left padding of the actor. It doesn't have a "column", per se.
Comment 54 Giovanni Campagna 2013-07-13 16:55:53 UTC
Review of attachment 248892 [details] [review]:

After IRC discussion, this is not significantly more broken than now, so ok.
Comment 55 Giovanni Campagna 2013-07-13 16:56:20 UTC
Review of attachment 248889 [details] [review]:

Ok then.
Comment 56 Jasper St. Pierre (not reading bugmail) 2013-07-15 16:05:31 UTC
(In reply to comment #52)
> Do we want to hide the triangle as well?
> Is it in the designs?
> 
> To me, it doesn't look right: the item is still a submenu item, even if
> disabled.

Sort of. See the design here.

https://raw.github.com/gnome-design-team/gnome-mockups/master/shell/system-menu/combined-system-status-menu-v3-examples.png

If we don't have an active user session (locked, greeter) we hide the submenu and triangle. I'm fine with a "setShowTriangle" or something if you think that sensitivity shouldn't be tied to visibility, though I think that the triangle implies it can be clicked, and I'd hate to see people hover over the triangle, expecting a traditional menu to pop to the side after a timeout.
Comment 57 Jasper St. Pierre (not reading bugmail) 2013-07-15 16:12:38 UTC
(In reply to comment #44)
> Review of attachment 248888 [details] [review]:
> Can you have more than one children with span == -1? (Does it even make sense?)
> And how about the alignment of them? Are they all in the first column?

No, you can't. Well, you can, but what happens is that it spills out of the allocation, you see some ugly overlapping stuff, and Clutter starts spewing invalid allocation warnings.

I should have probably written the commit message better, but the patch was motivated by the menu being too wide, because spanning actors (volume sliders) were counted as in the first column, but allocated across the entire space.

Now that we have a fixed width design for the aggregate menu, I'm just going to drop this altogether.
Comment 58 Jasper St. Pierre (not reading bugmail) 2013-07-15 16:15:47 UTC
(In reply to comment #46)
> Don't we stop closing submenus during the closing animation in a previous
> patch?

There's two patches: 1) don't close submenus when activating an item within the submenu, 2) don't close all submenus when closing the toplevel.

If you want me to squash them together, I can, but I don't know what the commit message would be.
Comment 59 Giovanni Campagna 2013-07-15 16:20:04 UTC
(In reply to comment #58)
> (In reply to comment #46)
> > Don't we stop closing submenus during the closing animation in a previous
> > patch?
> 
> There's two patches: 1) don't close submenus when activating an item within the
> submenu, 2) don't close all submenus when closing the toplevel.
> 
> If you want me to squash them together, I can, but I don't know what the commit
> message would be.

How about "don't close the submenus when their container is closing"?
After call, the problem with activating the item inside the submenu is that it closes the entire menu.

(In reply to comment #56)
> (In reply to comment #52)
> > Do we want to hide the triangle as well?
> > Is it in the designs?
> > 
> > To me, it doesn't look right: the item is still a submenu item, even if
> > disabled.
> 
> Sort of. See the design here.
> 
> https://raw.github.com/gnome-design-team/gnome-mockups/master/shell/system-menu/combined-system-status-menu-v3-examples.png
> 
> If we don't have an active user session (locked, greeter) we hide the submenu
> and triangle. I'm fine with a "setShowTriangle" or something if you think that
> sensitivity shouldn't be tied to visibility, though I think that the triangle
> implies it can be clicked, and I'd hate to see people hover over the triangle,
> expecting a traditional menu to pop to the side after a timeout.

Is that the only use case we have for submenus?
In that case, I guess setSensitivity is fine.
Comment 60 Jasper St. Pierre (not reading bugmail) 2013-07-15 16:23:52 UTC
(In reply to comment #59)
> Is that the only use case we have for submenus?
> In that case, I guess setSensitivity is fine.

In core, yes. There's also RemoteMenu, but technically we also need to support nested submenus (and we don't).

There's the extension usecases and classic mode, but I don't ever know if we use sensitivity with those.
Comment 61 Jasper St. Pierre (not reading bugmail) 2013-07-15 16:37:14 UTC
Attachment 248884 [details] pushed as c1e2d66 - popupMenu: Add a simple way to get the toplevel for a submenu / section
Attachment 248885 [details] pushed as 7db0900 - popupMenu: Introduce a way of closing toplevels from sections
Attachment 248887 [details] pushed as 2fa4055 - popupMenu: Simplify allocation code
Attachment 248889 [details] pushed as ef1eabf - popupMenu: Ignore submenus when getting the column widths
Attachment 248891 [details] pushed as 1e781ec - popupMenu: Remove connectSubMenuSignals
Attachment 248892 [details] pushed as 2634747 - popupMenu: Emit open-state-changed at the start of animating a submenu
Attachment 248893 [details] pushed as 5c036ea - popupMenu: Only allow one submenu to be open at a time
Attachment 248894 [details] pushed as bc317bf - popupMenu: Remove 'sensitive' input param
Attachment 248895 [details] pushed as 86835db - popupMenu: Propagate sensitivity to menu children
Attachment 248896 [details] pushed as 4b889ea - popupMenu: Ensure that submenus are properly hidden when insensitive


Pushed with fixes and squashing.