From 7626f74b8562ba8f1440f52ebf34f2f6131af545 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Wed, 11 Apr 2007 17:15:54 +0000 Subject: [PATCH] Advertise support of Above and Below operations (assuming the proposed 2007-04-11 Elijah Newren Advertise support of Above and Below operations (assuming the proposed EWMH additions of _NET_WM_ACTION_(ABOVE|BELOW) will be accepted, otherwise these changes will have to be modified). Part of #115247. * src/display.[ch] (meta_display_open, struct MetaDisplay): * src/screen.c (set_wm_check_hint): Add support for _NET_WM_ACTION_ABOVE and _NET_WM_ACTION_BELOW * src/window.c (set_allowed_actions_hints): add active_above and action_below svn path=/trunk/; revision=3190 --- ChangeLog | 14 ++++++++++++++ src/display.c | 6 +++++- src/display.h | 2 ++ src/screen.c | 4 +++- src/window.c | 8 +++++++- 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index fce5c5a6b..f6cad704b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2007-04-11 Elijah Newren + + Advertise support of Above and Below operations (assuming the + proposed EWMH additions of _NET_WM_ACTION_(ABOVE|BELOW) will be + accepted, otherwise these changes will have to be modified). Part + of #115247. + + * src/display.[ch] (meta_display_open, struct MetaDisplay): + * src/screen.c (set_wm_check_hint): + Add support for _NET_WM_ACTION_ABOVE and _NET_WM_ACTION_BELOW + + * src/window.c (set_allowed_actions_hints): + add active_above and action_below + 2007-04-10 Elijah Newren * src/window.c (recalc_window_features): make sure to set diff --git a/src/display.c b/src/display.c index 16cea44b1..637e60b9e 100644 --- a/src/display.c +++ b/src/display.c @@ -334,7 +334,9 @@ meta_display_open (void) "_METACITY_VERSION", "_NET_WM_VISIBLE_NAME", "_NET_WM_VISIBLE_ICON_NAME", - "_NET_WM_USER_TIME_WINDOW" + "_NET_WM_USER_TIME_WINDOW", + "_NET_WM_ACTION_ABOVE", + "_NET_WM_ACTION_BELOW" }; Atom atoms[G_N_ELEMENTS(atom_names)]; @@ -494,6 +496,8 @@ meta_display_open (void) display->atom_net_wm_visible_name = atoms[92]; display->atom_net_wm_visible_icon_name = atoms[93]; display->atom_net_wm_user_time_window = atoms[94]; + display->atom_net_wm_action_above = atoms[95]; + display->atom_net_wm_action_below = atoms[96]; display->prop_hooks = NULL; meta_display_init_window_prop_hooks (display); diff --git a/src/display.h b/src/display.h index 59585f162..b934d7180 100644 --- a/src/display.h +++ b/src/display.h @@ -159,6 +159,8 @@ struct _MetaDisplay Atom atom_net_wm_action_maximize_vert; Atom atom_net_wm_action_change_desktop; Atom atom_net_wm_action_close; + Atom atom_net_wm_action_above; + Atom atom_net_wm_action_below; Atom atom_net_wm_state_above; Atom atom_net_wm_state_below; Atom atom_net_startup_id; diff --git a/src/screen.c b/src/screen.c index ab470c94d..6fbe81399 100644 --- a/src/screen.c +++ b/src/screen.c @@ -89,7 +89,7 @@ set_wm_check_hint (MetaScreen *screen) static int set_supported_hint (MetaScreen *screen) { -#define N_SUPPORTED 60 +#define N_SUPPORTED 62 Atom atoms[N_SUPPORTED]; atoms[0] = screen->display->atom_net_wm_name; @@ -152,6 +152,8 @@ set_supported_hint (MetaScreen *screen) atoms[57] = screen->display->atom_net_desktop_viewport; atoms[58] = screen->display->atom_net_wm_user_time_window; atoms[59] = screen->display->atom_net_moveresize_window; + atoms[60] = screen->display->atom_net_wm_action_above; + atoms[61] = screen->display->atom_net_wm_action_below; /* atoms[58] = screen->display->atom_net_restack_window; */ diff --git a/src/window.c b/src/window.c index 9aaa682d8..78c6e992e 100644 --- a/src/window.c +++ b/src/window.c @@ -6035,7 +6035,7 @@ recalc_window_type (MetaWindow *window) static void set_allowed_actions_hint (MetaWindow *window) { -#define MAX_N_ACTIONS 10 +#define MAX_N_ACTIONS 12 unsigned long data[MAX_N_ACTIONS]; int i; @@ -6081,6 +6081,12 @@ set_allowed_actions_hint (MetaWindow *window) ++i; } + /* I guess we always allow above/below operations */ + data[i] = window->display->atom_net_wm_action_above; + ++i; + data[i] = window->display->atom_net_wm_action_below; + ++i; + g_assert (i <= MAX_N_ACTIONS); meta_verbose ("Setting _NET_WM_ALLOWED_ACTIONS with %d atoms\n", i);