add support for _NET_WM_ACTION_ABOVE and _NET_WM_ACTION_BELOW which aren't in the NETWM spec yet, but will be shortly.

This commit is contained in:
Dana Jansens 2007-05-13 17:15:15 +00:00
parent 0ee1581824
commit 11df262d7e
6 changed files with 26 additions and 6 deletions

View file

@ -1594,7 +1594,9 @@ void client_setup_decor_and_functions(ObClient *self)
OB_CLIENT_FUNC_ICONIFY | OB_CLIENT_FUNC_ICONIFY |
OB_CLIENT_FUNC_MAXIMIZE | OB_CLIENT_FUNC_MAXIMIZE |
OB_CLIENT_FUNC_SHADE | OB_CLIENT_FUNC_SHADE |
OB_CLIENT_FUNC_CLOSE); OB_CLIENT_FUNC_CLOSE |
OB_CLIENT_FUNC_BELOW |
OB_CLIENT_FUNC_ABOVE);
if (!(self->min_size.width < self->max_size.width || if (!(self->min_size.width < self->max_size.width ||
self->min_size.height < self->max_size.height)) self->min_size.height < self->max_size.height))
@ -1626,10 +1628,15 @@ void client_setup_decor_and_functions(ObClient *self)
self->functions = OB_CLIENT_FUNC_MOVE; self->functions = OB_CLIENT_FUNC_MOVE;
case OB_CLIENT_TYPE_DESKTOP: case OB_CLIENT_TYPE_DESKTOP:
case OB_CLIENT_TYPE_DOCK:
/* these windows are not manipulated by the window manager */ /* these windows are not manipulated by the window manager */
self->decorations = 0; self->decorations = 0;
self->functions = 0; self->functions = 0;
case OB_CLIENT_TYPE_DOCK:
/* these windows are not manipulated by the window manager, but they
can set below layer which has a special meaning */
self->decorations = 0;
self->functions = OB_CLIENT_FUNC_BELOW;
break; break;
} }
@ -1719,7 +1726,7 @@ void client_setup_decor_and_functions(ObClient *self)
static void client_change_allowed_actions(ObClient *self) static void client_change_allowed_actions(ObClient *self)
{ {
gulong actions[9]; gulong actions[11];
gint num = 0; gint num = 0;
/* desktop windows are kept on all desktops */ /* desktop windows are kept on all desktops */
@ -1742,6 +1749,10 @@ static void client_change_allowed_actions(ObClient *self)
actions[num++] = prop_atoms.net_wm_action_maximize_horz; actions[num++] = prop_atoms.net_wm_action_maximize_horz;
actions[num++] = prop_atoms.net_wm_action_maximize_vert; actions[num++] = prop_atoms.net_wm_action_maximize_vert;
} }
if (self->functions & OB_CLIENT_FUNC_ABOVE)
actions[num++] = prop_atoms.net_wm_action_above;
if (self->functions & OB_CLIENT_FUNC_BELOW)
actions[num++] = prop_atoms.net_wm_action_below;
PROP_SETA32(self->window, net_wm_allowed_actions, atom, actions, num); PROP_SETA32(self->window, net_wm_allowed_actions, atom, actions, num);

View file

@ -71,7 +71,9 @@ typedef enum
OB_CLIENT_FUNC_MAXIMIZE = 1 << 3, /*!< Allow to be maximized */ OB_CLIENT_FUNC_MAXIMIZE = 1 << 3, /*!< Allow to be maximized */
OB_CLIENT_FUNC_SHADE = 1 << 4, /*!< Allow to be shaded */ OB_CLIENT_FUNC_SHADE = 1 << 4, /*!< Allow to be shaded */
OB_CLIENT_FUNC_FULLSCREEN = 1 << 5, /*!< Allow to be made fullscreen */ OB_CLIENT_FUNC_FULLSCREEN = 1 << 5, /*!< Allow to be made fullscreen */
OB_CLIENT_FUNC_CLOSE = 1 << 6 /*!< Allow to be closed */ OB_CLIENT_FUNC_CLOSE = 1 << 6, /*!< Allow to be closed */
OB_CLIENT_FUNC_ABOVE = 1 << 7, /*!< Allow to be put in lower layer */
OB_CLIENT_FUNC_BELOW = 1 << 8 /*!< Allow to be put in higher layer */
} ObFunctions; } ObFunctions;
struct _ObClient struct _ObClient

View file

@ -176,13 +176,13 @@ static gboolean layer_menu_update(ObMenuFrame *frame, gpointer data)
if (e->type == OB_MENU_ENTRY_TYPE_NORMAL) { if (e->type == OB_MENU_ENTRY_TYPE_NORMAL) {
switch (e->id) { switch (e->id) {
case LAYER_TOP: case LAYER_TOP:
*en = !c->above; *en = !c->above && (c->functions & OB_CLIENT_FUNC_ABOVE);
break; break;
case LAYER_NORMAL: case LAYER_NORMAL:
*en = c->above || c->below; *en = c->above || c->below;
break; break;
case LAYER_BOTTOM: case LAYER_BOTTOM:
*en = !c->below; *en = !c->below && (c->functions & OB_CLIENT_FUNC_BELOW);
break; break;
default: default:
*en = TRUE; *en = TRUE;

View file

@ -135,6 +135,9 @@ void prop_startup()
CREATE(net_wm_action_fullscreen, "_NET_WM_ACTION_FULLSCREEN"); CREATE(net_wm_action_fullscreen, "_NET_WM_ACTION_FULLSCREEN");
CREATE(net_wm_action_change_desktop, "_NET_WM_ACTION_CHANGE_DESKTOP"); CREATE(net_wm_action_change_desktop, "_NET_WM_ACTION_CHANGE_DESKTOP");
CREATE(net_wm_action_close, "_NET_WM_ACTION_CLOSE"); CREATE(net_wm_action_close, "_NET_WM_ACTION_CLOSE");
CREATE(net_wm_action_above, "_NET_WM_ACTION_ABOVE");
CREATE(net_wm_action_below, "_NET_WM_ACTION_BELOW");
CREATE(net_wm_state_modal, "_NET_WM_STATE_MODAL"); CREATE(net_wm_state_modal, "_NET_WM_STATE_MODAL");
/* CREATE(net_wm_state_sticky, "_NET_WM_STATE_STICKY");*/ /* CREATE(net_wm_state_sticky, "_NET_WM_STATE_STICKY");*/
CREATE(net_wm_state_maximized_vert, "_NET_WM_STATE_MAXIMIZED_VERT"); CREATE(net_wm_state_maximized_vert, "_NET_WM_STATE_MAXIMIZED_VERT");

View file

@ -160,6 +160,8 @@ typedef struct Atoms {
Atom net_wm_action_fullscreen; Atom net_wm_action_fullscreen;
Atom net_wm_action_change_desktop; Atom net_wm_action_change_desktop;
Atom net_wm_action_close; Atom net_wm_action_close;
Atom net_wm_action_above;
Atom net_wm_action_below;
Atom net_wm_state_modal; Atom net_wm_state_modal;
/* Atom net_wm_state_sticky;*/ /* Atom net_wm_state_sticky;*/

View file

@ -258,6 +258,8 @@ gboolean screen_annex(const gchar *program_name)
supported[i++] = prop_atoms.net_wm_action_fullscreen; supported[i++] = prop_atoms.net_wm_action_fullscreen;
supported[i++] = prop_atoms.net_wm_action_change_desktop; supported[i++] = prop_atoms.net_wm_action_change_desktop;
supported[i++] = prop_atoms.net_wm_action_close; supported[i++] = prop_atoms.net_wm_action_close;
supported[i++] = prop_atoms.net_wm_action_above;
supported[i++] = prop_atoms.net_wm_action_below;
supported[i++] = prop_atoms.net_wm_state; supported[i++] = prop_atoms.net_wm_state;
supported[i++] = prop_atoms.net_wm_state_modal; supported[i++] = prop_atoms.net_wm_state_modal;
supported[i++] = prop_atoms.net_wm_state_maximized_vert; supported[i++] = prop_atoms.net_wm_state_maximized_vert;