[Xfce4-commits] [xfce/xfwm4] 02/02: Add support for gtk window menu

noreply at xfce.org noreply at xfce.org
Tue Feb 24 22:39:00 CET 2015


This is an automated email from the git hooks/post-receive script.

olivier pushed a commit to branch master
in repository xfce/xfwm4.

commit 75e950008b0b57caa3045806cf3a9ead65966d07
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Tue Feb 24 22:35:11 2015 +0100

    Add support for gtk window menu
    
    Bug: 11590
    
    Signed-off-by: Olivier Fourdan <fourdan at xfce.org>
---
 src/display.c |    1 +
 src/display.h |    1 +
 src/events.c  |   14 +++++++++++++-
 src/hints.c   |    4 ++++
 4 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/src/display.c b/src/display.c
index 694ed4f..e676fe1 100644
--- a/src/display.c
+++ b/src/display.c
@@ -78,6 +78,7 @@ myDisplayInitAtoms (DisplayInfo *display_info)
         "COMPOSITING_MANAGER",
         "_GTK_FRAME_EXTENTS",
         "_GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED",
+        "_GTK_SHOW_WINDOW_MENU",
         "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR",
         "KWM_WIN_ICON",
         "_MOTIF_WM_HINTS",
diff --git a/src/display.h b/src/display.h
index 4560cde..19412be 100644
--- a/src/display.h
+++ b/src/display.h
@@ -172,6 +172,7 @@ enum
     COMPOSITING_MANAGER = 0,
     GTK_FRAME_EXTENTS,
     GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED,
+    GTK_SHOW_WINDOW_MENU,
     KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR,
     KWM_WIN_ICON,
     MOTIF_WM_HINTS,
diff --git a/src/events.c b/src/events.c
index 4876742..ba138c5 100644
--- a/src/events.c
+++ b/src/events.c
@@ -1960,6 +1960,12 @@ handleClientMessage (DisplayInfo *display_info, XClientMessageEvent * ev)
             clientSetFullscreenMonitor (c, (gint) ev->data.l[0], (gint) ev->data.l[1],
                                            (gint) ev->data.l[2], (gint) ev->data.l[3]);
         }
+        else if ((ev->message_type == display_info->atoms[GTK_SHOW_WINDOW_MENU]) && (ev->format == 32))
+        {
+            TRACE ("client \"%s\" (0x%lx) has received a GTK_SHOW_WINDOW_MENU event", c->name, c->window);
+            show_window_menu (c, (gint) ev->data.l[1], (gint) ev->data.l[2], Button3, (Time) myDisplayGetCurrentTime (display_info));
+        }
+
     }
     else
     {
@@ -2414,7 +2420,7 @@ show_window_menu (Client *c, gint px, gint py, guint button, guint32 timestamp)
         return;
     }
 
-    if (!c || !FLAG_TEST_ALL (c->xfwm_flags, XFWM_FLAG_HAS_MENU | XFWM_FLAG_VISIBLE))
+    if (!c || !FLAG_TEST (c->xfwm_flags, XFWM_FLAG_VISIBLE))
     {
         return;
     }
@@ -2473,6 +2479,12 @@ show_window_menu (Client *c, gint px, gint py, guint button, guint32 timestamp)
         ops |= MENU_OP_STICK;
     }
 
+    if (!FLAG_TEST (c->xfwm_flags, XFWM_FLAG_HAS_BORDER))
+    {
+        insensitive |= MENU_OP_SHADE | MENU_OP_UNSHADE;
+    }
+
+
     if (!FLAG_TEST (c->xfwm_flags, XFWM_FLAG_HAS_CLOSE))
     {
         insensitive |= MENU_OP_DELETE;
diff --git a/src/hints.c b/src/hints.c
index d955ac1..1dce39c 100644
--- a/src/hints.c
+++ b/src/hints.c
@@ -417,6 +417,10 @@ setNetSupportedHint (DisplayInfo *display_info, Window root, Window check_win)
     atoms[i++] = display_info->atoms[NET_WM_WINDOW_TYPE_TOOLBAR];
     atoms[i++] = display_info->atoms[NET_WM_WINDOW_TYPE_UTILITY];
     atoms[i++] = display_info->atoms[NET_WORKAREA];
+    /* GTK specific hints */
+    atoms[i++] = display_info->atoms[GTK_FRAME_EXTENTS];
+    atoms[i++] = display_info->atoms[GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED];
+    atoms[i++] = display_info->atoms[GTK_SHOW_WINDOW_MENU];
 #ifdef HAVE_LIBSTARTUP_NOTIFICATION
     atoms[i++] = display_info->atoms[NET_STARTUP_ID];
 #endif

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list