windowMenu: Implement new show_menu_for_rect() hook

Having the full geometry of the menu's source button (if any) will
allow us to address several misbehaviors of window menus, so use
that instead of show_menu().

https://bugzilla.gnome.org/show_bug.cgi?id=731058
This commit is contained in:
Florian Müllner
2014-06-02 21:47:24 +02:00
parent 094669baee
commit 5b61f2d642
5 changed files with 40 additions and 7 deletions

View File

@ -151,7 +151,7 @@ const WindowMenuManager = new Lang.Class({
this._manager = new PopupMenu.PopupMenuManager({ actor: Main.layoutManager.dummyCursor });
},
showWindowMenuForWindow: function(window, type, x, y) {
showWindowMenuForWindow: function(window, type, rect) {
let menu = (type == Meta.WindowMenuType.WM) ? new WindowMenu(window)
: new AppMenu(window);
@ -161,7 +161,7 @@ const WindowMenuManager = new Lang.Class({
window.check_alive(global.get_current_time());
});
Main.layoutManager.setDummyCursorGeometry(x, y, 0, 0);
Main.layoutManager.setDummyCursorGeometry(rect.x, rect.y, 0, 0);
menu.open(BoxPointer.PopupAnimation.NONE);
menu.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
menu.connect('open-state-changed', Lang.bind(this, function(menu_, isOpen) {