[metacity] window: add support for _GTK_SHOW_WINDOW_MENU



commit 96f78cbaaa7f927a81a7abcfc553272ce2859df1
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Wed Aug 14 15:19:37 2019 +0300

    window: add support for _GTK_SHOW_WINDOW_MENU
    
    Based on mutter commits:
    https://gitlab.gnome.org/GNOME/mutter/commit/50b81fe4b9623dd34a1d9
    https://gitlab.gnome.org/GNOME/mutter/commit/6513cbb470a145217f524
    
    https://gitlab.gnome.org/GNOME/metacity/issues/5

 src/core/atomnames.h |  1 +
 src/core/screen.c    |  1 +
 src/core/window.c    | 16 ++++++++++++++++
 3 files changed, 18 insertions(+)
---
diff --git a/src/core/atomnames.h b/src/core/atomnames.h
index bab2630b..e44dc2f3 100644
--- a/src/core/atomnames.h
+++ b/src/core/atomnames.h
@@ -59,6 +59,7 @@ item(_METACITY_SET_MOUSEMODS_MESSAGE)
 item(_METACITY_TOGGLE_VERBOSE)
 item(_GTK_THEME_VARIANT)
 item(_GTK_FRAME_EXTENTS)
+item(_GTK_SHOW_WINDOW_MENU)
 item(_GNOME_PANEL_ACTION)
 item(_GNOME_PANEL_ACTION_MAIN_MENU)
 item(_GNOME_PANEL_ACTION_RUN_DIALOG)
diff --git a/src/core/screen.c b/src/core/screen.c
index 64143633..e83d6ebe 100644
--- a/src/core/screen.c
+++ b/src/core/screen.c
@@ -100,6 +100,7 @@ set_supported_hint (MetaScreen *screen)
 #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 8a9d3fad..a8fd3b8e 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -5825,6 +5825,22 @@ 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)
+    {
+      GdkRectangle rect;
+      guint32 timestamp;
+
+      /* l[0] is device_id, which we don't use */
+      rect.x = event->xclient.data.l[1];
+      rect.y = event->xclient.data.l[2];
+      rect.width = 0;
+      rect.height = 0;
+
+      timestamp = meta_display_get_current_time_roundtrip (display);
+
+      meta_window_show_menu (window, &rect, timestamp);
+    }
 
   return FALSE;
 }


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