ewmh: add support for _NET_WM_STATE_DEMANDS_ATTENTION

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-06-17 22:57:54 +02:00
parent f99e069a65
commit f13f09b4da
1 changed files with 16 additions and 0 deletions

16
ewmh.c
View File

@ -62,6 +62,7 @@ static xcb_atom_t net_wm_state_above;
static xcb_atom_t net_wm_state_below;
static xcb_atom_t net_wm_state_modal;
static xcb_atom_t net_wm_state_hidden;
static xcb_atom_t net_wm_state_demands_attention;
static xcb_atom_t utf8_string;
@ -103,6 +104,7 @@ static AtomItem AtomNames[] =
{ "_NET_WM_STATE_BELOW", &net_wm_state_below },
{ "_NET_WM_STATE_MODAL", &net_wm_state_modal },
{ "_NET_WM_STATE_HIDDEN", &net_wm_state_hidden },
{ "_NET_WM_STATE_DEMANDS_ATTENTION", &net_wm_state_demands_attention },
{ "UTF8_STRING", &utf8_string },
};
@ -178,6 +180,7 @@ ewmh_set_supported_hints(int phys_screen)
atom[i++] = net_wm_state_below;
atom[i++] = net_wm_state_modal;
atom[i++] = net_wm_state_hidden;
atom[i++] = net_wm_state_demands_attention;
xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
xscreen->root, net_supported, ATOM, 32, i, atom);
@ -444,6 +447,19 @@ ewmh_process_state_atom(client_t *c, xcb_atom_t state, int set)
c->ishidden = true;
globalconf.screens[c->screen].need_arrange = true;
}
else if(state == net_wm_state_demands_attention)
{
if(set == _NET_WM_STATE_REMOVE)
c->isurgent = false;
else if(set == _NET_WM_STATE_ADD)
{
c->isurgent = true;
/* execute hook */
luaA_client_userdata_new(c);
luaA_dofunction(globalconf.L, globalconf.hooks.urgent, 1);
widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS);
}
}
}
static void