Handle _NET_WM_STATE_STICKY, but only for floating containers. If this atom is set, the floating window will always be automatically moved to the currently active workspace of the output that it is on. This is the equivalent of a sticky note stuck to the monitor.
We will respect this atom upon managing a window as well as when we receive a request that changes the sticky state. fixes #1455
This commit is contained in:
@ -695,7 +695,8 @@ static void handle_client_message(xcb_client_message_event_t *event) {
|
||||
if (event->type == A__NET_WM_STATE) {
|
||||
if (event->format != 32 ||
|
||||
(event->data.data32[1] != A__NET_WM_STATE_FULLSCREEN &&
|
||||
event->data.data32[1] != A__NET_WM_STATE_DEMANDS_ATTENTION)) {
|
||||
event->data.data32[1] != A__NET_WM_STATE_DEMANDS_ATTENTION &&
|
||||
event->data.data32[1] != A__NET_WM_STATE_STICKY)) {
|
||||
DLOG("Unknown atom in clientmessage of type %d\n", event->data.data32[1]);
|
||||
return;
|
||||
}
|
||||
@ -725,6 +726,16 @@ static void handle_client_message(xcb_client_message_event_t *event) {
|
||||
con_set_urgency(con, false);
|
||||
else if (event->data.data32[0] == _NET_WM_STATE_TOGGLE)
|
||||
con_set_urgency(con, !con->urgent);
|
||||
} else if (event->data.data32[1] == A__NET_WM_STATE_STICKY) {
|
||||
DLOG("Received a client message to modify _NET_WM_STATE_STICKY.\n");
|
||||
if (event->data.data32[0] == _NET_WM_STATE_ADD)
|
||||
con->sticky = true;
|
||||
else if (event->data.data32[0] == _NET_WM_STATE_REMOVE)
|
||||
con->sticky = false;
|
||||
else if (event->data.data32[0] == _NET_WM_STATE_TOGGLE)
|
||||
con->sticky = !con->sticky;
|
||||
|
||||
DLOG("New sticky status for con = %p is %i.\n", con, con->sticky);
|
||||
}
|
||||
|
||||
tree_render();
|
||||
|
Reference in New Issue
Block a user