[gnome-shell] windowManager: Support coords



commit 752aca811cc8d00dd07ab83200f2ffe8f821d36f
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu May 22 10:22:11 2014 -0400

    windowManager: Support coords

 js/ui/windowManager.js   |    4 ++--
 js/ui/windowMenu.js      |    3 +--
 src/gnome-shell-plugin.c |   10 +++++++---
 src/shell-wm-private.h   |    4 +++-
 src/shell-wm.c           |   10 ++++++----
 5 files changed, 19 insertions(+), 12 deletions(-)
---
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index 0acf4f6..8121dc0 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -1163,8 +1163,8 @@ const WindowManager = new Lang.Class({
         this._tilePreview.hide();
     },
 
-    _showWindowMenu: function(shellwm, window) {
-        this._windowMenuManager.showForWindow(window);
+    _showWindowMenu: function(shellwm, window, x, y) {
+        this._windowMenuManager.showForWindow(window, x, y);
     },
 
     _startAppSwitcher : function(display, screen, window, binding) {
diff --git a/js/ui/windowMenu.js b/js/ui/windowMenu.js
index 772479b..3dc85c6 100644
--- a/js/ui/windowMenu.js
+++ b/js/ui/windowMenu.js
@@ -129,11 +129,10 @@ const WindowMenuManager = new Lang.Class({
         this._manager = new PopupMenu.PopupMenuManager({ actor: Main.layoutManager.dummyCursor });
     },
 
-    showForWindow: function(window) {
+    showForWindow: function(window, x, y) {
         let menu = new WindowMenu(window);
         this._manager.addMenu(menu);
 
-        let [x, y] = global.get_pointer();
         Main.layoutManager.setDummyCursorGeometry(x, y, 0, 0);
         menu.open(BoxPointer.PopupAnimation.NONE);
         menu.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
diff --git a/src/gnome-shell-plugin.c b/src/gnome-shell-plugin.c
index 75a3bdd..618a068 100644
--- a/src/gnome-shell-plugin.c
+++ b/src/gnome-shell-plugin.c
@@ -74,7 +74,9 @@ static void gnome_shell_plugin_show_tile_preview (MetaPlugin      *plugin,
                                                   int              tile_monitor);
 static void gnome_shell_plugin_hide_tile_preview (MetaPlugin *plugin);
 static void gnome_shell_plugin_show_window_menu  (MetaPlugin *plugin,
-                                                  MetaWindow *window);
+                                                  MetaWindow *window,
+                                                  int         x,
+                                                  int         y);
 
 static gboolean              gnome_shell_plugin_xevent_filter (MetaPlugin *plugin,
                                                                XEvent     *event);
@@ -307,9 +309,11 @@ gnome_shell_plugin_hide_tile_preview (MetaPlugin *plugin)
 
 static void
 gnome_shell_plugin_show_window_menu (MetaPlugin *plugin,
-                                     MetaWindow *window)
+                                     MetaWindow *window,
+                                     int         x,
+                                     int         y)
 {
-  _shell_wm_show_window_menu (get_shell_wm (), window);
+  _shell_wm_show_window_menu (get_shell_wm (), window, x, y);
 }
 
 static gboolean
diff --git a/src/shell-wm-private.h b/src/shell-wm-private.h
index 35cbcb0..d5c02e5 100644
--- a/src/shell-wm-private.h
+++ b/src/shell-wm-private.h
@@ -41,7 +41,9 @@ void _shell_wm_show_tile_preview     (ShellWM             *wm,
                                       int                  tile_monitor);
 void _shell_wm_hide_tile_preview     (ShellWM             *wm);
 void _shell_wm_show_window_menu      (ShellWM             *wm,
-                                      MetaWindow          *window);
+                                      MetaWindow          *window,
+                                      int                  x,
+                                      int                  y);
 
 gboolean _shell_wm_filter_keybinding (ShellWM             *wm,
                                       MetaKeyBinding      *binding);
diff --git a/src/shell-wm.c b/src/shell-wm.c
index 0d51606..50ecb7e 100644
--- a/src/shell-wm.c
+++ b/src/shell-wm.c
@@ -141,8 +141,8 @@ shell_wm_class_init (ShellWMClass *klass)
                   G_TYPE_FROM_CLASS (klass),
                   G_SIGNAL_RUN_LAST,
                   0, NULL, NULL, NULL,
-                  G_TYPE_NONE, 1,
-                  META_TYPE_WINDOW);
+                  G_TYPE_NONE, 3,
+                  META_TYPE_WINDOW, G_TYPE_INT, G_TYPE_INT);
   shell_wm_signals[FILTER_KEYBINDING] =
     g_signal_new ("filter-keybinding",
                   G_TYPE_FROM_CLASS (klass),
@@ -298,9 +298,11 @@ _shell_wm_hide_tile_preview (ShellWM *wm)
 
 void
 _shell_wm_show_window_menu (ShellWM    *wm,
-                            MetaWindow *window)
+                            MetaWindow *window,
+                            int         x,
+                            int         y)
 {
-  g_signal_emit (wm, shell_wm_signals[SHOW_WINDOW_MENU], 0, window);
+  g_signal_emit (wm, shell_wm_signals[SHOW_WINDOW_MENU], 0, window, x, y);
 }
 
 void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]