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 726352 - Implement window menus in gnome-shell
Implement window menus in gnome-shell
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
: 647773 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-03-14 15:25 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2015-02-21 17:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
window: Add a META_MAXIMIZE_BOTH maximization flag (10.08 KB, patch)
2014-03-14 15:25 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
window: Export a bunch of state flags as accessor methods (3.39 KB, patch)
2014-03-14 15:25 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
Convert window menus to use a compositor implementation (65.46 KB, patch)
2014-03-14 15:25 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
window: Remove unused and unnecessary parameters from meta_window_window_menu (6.89 KB, patch)
2014-03-14 15:26 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
Implement window menus in gnome-shell (11.70 KB, patch)
2014-03-14 15:26 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
Implement window menus in gnome-shell (11.81 KB, patch)
2014-03-15 19:45 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2014-03-14 15:25:49 UTC
This is something we've wanted to do for a long time for code
clarity reasons and design reasons. Wayland really gives us
the first opportunity to do it.
Comment 1 Jasper St. Pierre (not reading bugmail) 2014-03-14 15:25:52 UTC
Created attachment 271911 [details] [review]
window: Add a META_MAXIMIZE_BOTH maximization flag

Which has both directions set. This is a simple cleanup to
remove the constant VERTICAL | HORIZONTAL all over the place.
Comment 2 Jasper St. Pierre (not reading bugmail) 2014-03-14 15:25:55 UTC
Created attachment 271912 [details] [review]
window: Export a bunch of state flags as accessor methods

This is necessary to reimplement window menus in gnome-shell.
Comment 3 Jasper St. Pierre (not reading bugmail) 2014-03-14 15:25:59 UTC
Created attachment 271913 [details] [review]
Convert window menus to use a compositor implementation

Window menus being GTK+ widgets has always been frustrating
to deal with. Under Wayland, GTK+ is using the X11 backend,
so the menus there pop up in the wrong place, don't take a
grab, and are unstyled.

Given that we have a sophisticated menu system as a replacement
in gnome-shell, we can port over to using that instead.

This does remove window menus for the default plugin, but given
how we've been steadily removing features for that the entire
time, I'm OK with this tradeoff.

This removes the bare minimum of unused code I could find. There's
probably still a lot of code left working around GTK+'s grab
tracking that could go away entirely. A full cleanup should be
done later.
Comment 4 Jasper St. Pierre (not reading bugmail) 2014-03-14 15:26:03 UTC
Created attachment 271914 [details] [review]
window: Remove unused and unnecessary parameters from meta_window_window_menu

These were needed at one time, but not anymore. The menu system
always puts the window menu on the cursor.
Comment 5 Jasper St. Pierre (not reading bugmail) 2014-03-14 15:26:22 UTC
Created attachment 271915 [details] [review]
Implement window menus in gnome-shell
Comment 6 Florian Müllner 2014-03-15 08:40:35 UTC
Review of attachment 271911 [details] [review]:

Sure.
Comment 7 Florian Müllner 2014-03-15 08:41:00 UTC
Review of attachment 271912 [details] [review]:

OK
Comment 8 Florian Müllner 2014-03-15 08:46:02 UTC
IMHO the other patches might be 3.12.1 material if the keynav regression is fixed and we get the correspondent GTK+ changes; so not reviewing the remaining patches for now.
Comment 9 Jasper St. Pierre (not reading bugmail) 2014-03-15 13:50:45 UTC
Attachment 271911 [details] pushed as 24e1205 - window: Add a META_MAXIMIZE_BOTH maximization flag
Attachment 271912 [details] pushed as 4f9872c - window: Export a bunch of state flags as accessor methods
Comment 10 Jasper St. Pierre (not reading bugmail) 2014-03-15 19:45:52 UTC
Created attachment 272028 [details] [review]
Implement window menus in gnome-shell

This cheaply fixes the keyboard navigation issue. It's not perfect,
but it's the best I can do without completely refactoring PopupMenu.

This might be good enough for the Wayland branch, but we might want
to hold off on it for X11.
Comment 11 Florian Müllner 2014-04-24 14:16:01 UTC
Review of attachment 271913 [details] [review]:

LG, assuming the patch is rebased properly (CompScreen removal etc.)
Comment 12 Florian Müllner 2014-04-24 14:16:10 UTC
Review of attachment 271914 [details] [review]:

The commit messages makes it sound like those parameters had been unused for some time, not just the previous commit; moreover, it seems a bit arbitrary to split this out, but not the removal of other unused stuff (MetaAccelLabel, MetaWindowMenu) - please just squash with the previous commit.
Comment 13 Florian Müllner 2014-04-24 14:16:23 UTC
Review of attachment 272028 [details] [review]:

::: js/ui/windowMenu.js
@@ +1,3 @@
+// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*
+
+const Clutter = imports.gi.Clutter;

Unused import

@@ +6,3 @@
+const Meta = imports.gi.Meta;
+const St = imports.gi.St;
+const Shell = imports.gi.Shell;

Dto.

@@ +106,3 @@
+                    }));
+                }
+                if (workspace < nWorkspaces) {

That's broken => s/workspace/idx/

@@ +136,3 @@
+
+        let [x, y] = global.get_pointer();
+        Main.layoutManager.setDummyCursorPosition(x, y);

In case you haven't updated this already, setDummyCursorPosition got renamed to setDummyCursorGeometry
Comment 14 Florian Müllner 2014-04-26 14:19:52 UTC
*** Bug 647773 has been marked as a duplicate of this bug. ***
Comment 15 Jasper St. Pierre (not reading bugmail) 2014-05-17 19:22:59 UTC
Attachment 272028 [details] pushed as e7af257 - Implement window menus in gnome-shell


Pushed with suggested fixes
Comment 16 Benjamin Otte (Company) 2014-10-29 15:43:23 UTC
Now if I run stock mutter without gnome-shell and right-click on a header-bar, I don't get anything. Should muttter maybe not advertise support for the menu unless it actually has an implementation?