summaryrefslogtreecommitdiff
path: root/src/shell-wm.c
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2014-06-02 21:47:24 +0200
committerFlorian Müllner <fmuellner@gnome.org>2014-06-02 23:48:53 +0200
commit5b61f2d64263bd987a9b55a806b0b8be1a148eb2 (patch)
tree27175358592ab042ef8367643e48aa9a95cc8f53 /src/shell-wm.c
parent094669baee661086ac639e1813e704c0eff10149 (diff)
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
Diffstat (limited to 'src/shell-wm.c')
-rw-r--r--src/shell-wm.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/shell-wm.c b/src/shell-wm.c
index 928f5f10..67d03b8c 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, 4,
- META_TYPE_WINDOW, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT);
+ G_TYPE_NONE, 3,
+ META_TYPE_WINDOW, G_TYPE_INT, META_TYPE_RECTANGLE);
shell_wm_signals[FILTER_KEYBINDING] =
g_signal_new ("filter-keybinding",
G_TYPE_FROM_CLASS (klass),
@@ -303,7 +303,22 @@ _shell_wm_show_window_menu (ShellWM *wm,
int x,
int y)
{
- g_signal_emit (wm, shell_wm_signals[SHOW_WINDOW_MENU], 0, window, menu, x, y);
+ MetaRectangle rect;
+
+ rect.x = x;
+ rect.y = y;
+ rect.width = rect.height = 0;
+
+ _shell_wm_show_window_menu_for_rect (wm, window, menu, &rect);
+}
+
+void
+_shell_wm_show_window_menu_for_rect (ShellWM *wm,
+ MetaWindow *window,
+ MetaWindowMenuType menu,
+ MetaRectangle *rect)
+{
+ g_signal_emit (wm, shell_wm_signals[SHOW_WINDOW_MENU], 0, window, menu, rect);
}
void