diff options
author | Olivier Fourdan <fourdan@xfce.org> | 2015-02-24 22:35:11 +0100 |
---|---|---|
committer | Olivier Fourdan <fourdan@xfce.org> | 2015-02-24 22:38:43 +0100 |
commit | 75e950008b0b57caa3045806cf3a9ead65966d07 (patch) | |
tree | cee169decdfecc547624ec77a353daacd9fbd4a1 /src | |
parent | 68365da4bb048f03871ab32882e47098bd9d4218 (diff) | |
download | xfwm4-75e950008b0b57caa3045806cf3a9ead65966d07.tar.gz |
Add support for gtk window menu
Bug: 11590
Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/display.c | 1 | ||||
-rw-r--r-- | src/display.h | 1 | ||||
-rw-r--r-- | src/events.c | 14 | ||||
-rw-r--r-- | src/hints.c | 4 |
4 files changed, 19 insertions, 1 deletions
diff --git a/src/display.c b/src/display.c index 694ed4f41..e676fe155 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 4560cde30..19412be61 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 487674248..ba138c5a2 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 d955ac14f..1dce39cb5 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 |