Support _NET_WM_STATE_STICKY (i.e. allow third-party apps to decide

2008-10-23  Thomas Thurman  <tthurman@gnome.org>

        Support _NET_WM_STATE_STICKY (i.e. allow third-party apps to decide
        whether a window is on all workspaces).  Bug found by Ka-Hing
        Cheung.  Closes #557536.

        * src/core/window.c (set_net_wm_state): report it
        * src/core/window.c (meta_window_client_message): set sticky
          if we receive it
        * src/core/window-props.c: set sticky if we find it
        * src/core/atomnames.h: add _NET_WM_STATE_STICKY


svn path=/trunk/; revision=3991
This commit is contained in:
Thomas Thurman
2008-10-23 04:09:14 +00:00
committed by Thomas James Alexander Thurman
parent c91475f20f
commit ab9bdf228b
4 changed files with 34 additions and 4 deletions

View File

@@ -1228,7 +1228,7 @@ static void
set_net_wm_state (MetaWindow *window)
{
int i;
unsigned long data[11];
unsigned long data[12];
i = 0;
if (window->shaded)
@@ -1286,6 +1286,11 @@ set_net_wm_state (MetaWindow *window)
data[i] = window->display->atom__NET_WM_STATE_DEMANDS_ATTENTION;
++i;
}
if (window->on_all_workspaces)
{
data[i] = window->display->atom__NET_WM_STATE_STICKY;
++i;
}
meta_verbose ("Setting _NET_WM_STATE with %d atoms\n", i);
@@ -4928,9 +4933,19 @@ meta_window_client_message (MetaWindow *window,
{
if ((action == _NET_WM_STATE_ADD) ||
(action == _NET_WM_STATE_TOGGLE && !window->wm_state_demands_attention))
meta_window_set_demands_attention(window);
meta_window_set_demands_attention (window);
else
meta_window_unset_demands_attention(window);
meta_window_unset_demands_attention (window);
}
if (first == display->atom__NET_WM_STATE_STICKY ||
second == display->atom__NET_WM_STATE_STICKY)
{
if ((action == _NET_WM_STATE_ADD) ||
(action == _NET_WM_STATE_TOGGLE && !window->on_all_workspaces))
meta_window_stick (window);
else
meta_window_unstick (window);
}
return TRUE;