From 2cebadddb41ba4e5c2063ca9ce31fc5ed14300c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Weber?= Date: Fri, 29 Dec 2017 18:52:45 +0100 Subject: Add support for gtk3 _GTK_SHOW_WINDOW_MENU event --- src/core/atomnames.h | 1 + src/core/screen.c | 1 + src/core/window.c | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/src/core/atomnames.h b/src/core/atomnames.h index 2775d3db..cda2e33a 100644 --- a/src/core/atomnames.h +++ b/src/core/atomnames.h @@ -59,6 +59,7 @@ item(_MARCO_RELOAD_THEME_MESSAGE) item(_MARCO_SET_KEYBINDINGS_MESSAGE) item(_MARCO_TOGGLE_VERBOSE) item(_GTK_FRAME_EXTENTS) +item(_GTK_SHOW_WINDOW_MENU) item(_MATE_PANEL_ACTION) item(_MATE_PANEL_ACTION_MAIN_MENU) item(_MATE_PANEL_ACTION_RUN_DIALOG) diff --git a/src/core/screen.c b/src/core/screen.c index f0ce5dff..107a2d0b 100644 --- a/src/core/screen.c +++ b/src/core/screen.c @@ -103,6 +103,7 @@ set_supported_hint (MetaScreen *screen) #undef item #undef EWMH_ATOMS_ONLY screen->display->atom__GTK_FRAME_EXTENTS, + screen->display->atom__GTK_SHOW_WINDOW_MENU, }; XChangeProperty (screen->display->xdisplay, screen->xroot, diff --git a/src/core/window.c b/src/core/window.c index 530bc407..eec909aa 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -5399,6 +5399,27 @@ meta_window_client_message (MetaWindow *window, meta_window_update_fullscreen_monitors (window, top, bottom, left, right); } + else if (event->xclient.message_type == + display->atom__GTK_SHOW_WINDOW_MENU) + { + gulong x_root, y_root; + guint32 timestamp; + int button; + + if (meta_prefs_get_raise_on_click ()) + meta_window_raise (window); + + timestamp = meta_display_get_current_time_roundtrip (display); + x_root = event->xclient.data.l[1]; + y_root = event->xclient.data.l[2]; + button = 3; + + meta_window_show_menu (window, + x_root, + y_root, + button, + timestamp); + } return FALSE; } -- cgit v1.2.1