Implement _NET_WM_STATE_STICKY, bound to CM-s by default; allows any

client to 'stick' to all desktops (ewmh speak) or groups - this
currently has the same affect as setting a client's group to 'nogroup',
with the exception that the client can also be in a group, so when
un-sticking, the client will go back to its original group/desktop.
This commit is contained in:
okan
2014-08-25 12:49:19 +00:00
parent ed164794cb
commit 7314a3aefd
8 changed files with 47 additions and 3 deletions

View File

@ -238,6 +238,17 @@ client_freeze(struct client_ctx *cc)
cc->flags |= CLIENT_FREEZE;
}
void
client_sticky(struct client_ctx *cc)
{
if (cc->flags & CLIENT_STICKY)
cc->flags &= ~CLIENT_STICKY;
else
cc->flags |= CLIENT_STICKY;
xu_ewmh_set_net_wm_state(cc);
}
void
client_fullscreen(struct client_ctx *cc)
{
@ -468,6 +479,9 @@ client_ptrsave(struct client_ctx *cc)
void
client_hide(struct client_ctx *cc)
{
if (cc->flags & CLIENT_STICKY)
return;
XUnmapWindow(X_Dpy, cc->win);
cc->active = 0;
@ -481,6 +495,9 @@ client_hide(struct client_ctx *cc)
void
client_unhide(struct client_ctx *cc)
{
if (cc->flags & CLIENT_STICKY)
return;
XMapRaised(X_Dpy, cc->win);
cc->flags &= ~CLIENT_HIDDEN;