GNOME Bugzilla – Bug 726352
Implement window menus in gnome-shell
Last modified: 2015-02-21 17:51:25 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.
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.
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.
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.
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.
Created attachment 271915 [details] [review] Implement window menus in gnome-shell
Review of attachment 271911 [details] [review]: Sure.
Review of attachment 271912 [details] [review]: OK
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.
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
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.
Review of attachment 271913 [details] [review]: LG, assuming the patch is rebased properly (CompScreen removal etc.)
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.
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
*** Bug 647773 has been marked as a duplicate of this bug. ***
Attachment 272028 [details] pushed as e7af257 - Implement window menus in gnome-shell Pushed with suggested fixes
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?