aboutsummaryrefslogtreecommitdiffstats
path: root/xutil.c
diff options
context:
space:
mode:
authorokan2014-08-25 12:49:19 +0000
committerokan2014-08-25 12:49:19 +0000
commit69a4c46eec5a14a1d2e31092a91056655acdf8d5 (patch)
treec10c50866a4c73f0d0b589095ba3f9699563983e /xutil.c
parentae4c24de00ab3e9be5c41678e10d4f38d97274b2 (diff)
downloadcwm-69a4c46eec5a14a1d2e31092a91056655acdf8d5.tar.gz
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.
Diffstat (limited to 'xutil.c')
-rw-r--r--xutil.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/xutil.c b/xutil.c
index 368dc40..a5c1302 100644
--- a/xutil.c
+++ b/xutil.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: xutil.c,v 1.87 2014/08/22 19:04:00 okan Exp $
+ * $OpenBSD: xutil.c,v 1.88 2014/08/25 12:49:19 okan Exp $
*/
#include <sys/param.h>
@@ -326,6 +326,9 @@ xu_ewmh_handle_net_wm_state_msg(struct client_ctx *cc, int action,
int property;
void (*toggle)(struct client_ctx *);
} handlers[] = {
+ { _NET_WM_STATE_STICKY,
+ CLIENT_STICKY,
+ client_sticky },
{ _NET_WM_STATE_MAXIMIZED_VERT,
CLIENT_VMAXIMIZED,
client_vmaximize },
@@ -367,6 +370,8 @@ xu_ewmh_restore_net_wm_state(struct client_ctx *cc)
atoms = xu_ewmh_get_net_wm_state(cc, &n);
for (i = 0; i < n; i++) {
+ if (atoms[i] == ewmh[_NET_WM_STATE_STICKY])
+ client_sticky(cc);
if (atoms[i] == ewmh[_NET_WM_STATE_MAXIMIZED_HORZ])
client_hmaximize(cc);
if (atoms[i] == ewmh[_NET_WM_STATE_MAXIMIZED_VERT])
@@ -391,10 +396,13 @@ xu_ewmh_set_net_wm_state(struct client_ctx *cc)
if (oatoms[i] != ewmh[_NET_WM_STATE_MAXIMIZED_HORZ] &&
oatoms[i] != ewmh[_NET_WM_STATE_MAXIMIZED_VERT] &&
oatoms[i] != ewmh[_NET_WM_STATE_FULLSCREEN] &&
+ oatoms[i] != ewmh[_NET_WM_STATE_STICKY] &&
oatoms[i] != ewmh[_NET_WM_STATE_DEMANDS_ATTENTION])
atoms[j++] = oatoms[i];
}
free(oatoms);
+ if (cc->flags & CLIENT_STICKY)
+ atoms[j++] = ewmh[_NET_WM_STATE_STICKY];
if (cc->flags & CLIENT_FULLSCREEN)
atoms[j++] = ewmh[_NET_WM_STATE_FULLSCREEN];
else {