summary refs log tree commit diff
path: root/xutil.c
diff options
context:
space:
mode:
authorokan <okan>2017-12-19 14:30:53 +0000
committerokan <okan>2017-12-19 14:30:53 +0000
commitbc5215f41a5a8084b2496b7a3477a4cdac7b4695 (patch)
treec6e70df15afddaea1c9ae38fc3ff12a79cfdbc75 /xutil.c
parent5e5d06f06354f5d90aa11beaace16fa5e6e34cce (diff)
downloadcwm-bc5215f41a5a8084b2496b7a3477a4cdac7b4695.tar.gz
cwm-bc5215f41a5a8084b2496b7a3477a4cdac7b4695.tar.xz
cwm-bc5215f41a5a8084b2496b7a3477a4cdac7b4695.zip
Add support for _NET_WM_STATE_SKIP_PAGER and _NET_WM_STATE_SKIP_TASKBAR; eerily
close to cwm's 'ignore'.

Roughly based on an initial diff from Walter Alejandro Iglesias, but with
support for both Atoms and without cwm-based bindings.
Diffstat (limited to 'xutil.c')
-rw-r--r--xutil.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/xutil.c b/xutil.c
index 1b6faf0..7fd3115 100644
--- a/xutil.c
+++ b/xutil.c
@@ -368,6 +368,12 @@ xu_ewmh_handle_net_wm_state_msg(struct client_ctx *cc, int action,
 		{ _NET_WM_STATE_DEMANDS_ATTENTION,
 			CLIENT_URGENCY,
 			client_urgency },
+		{ _NET_WM_STATE_SKIP_PAGER,
+			CLIENT_SKIP_PAGER,
+			client_toggle_skip_pager},
+		{ _NET_WM_STATE_SKIP_TASKBAR,
+			CLIENT_SKIP_TASKBAR,
+			client_toggle_skip_taskbar},
 		{ _CWM_WM_STATE_FREEZE,
 			CLIENT_FREEZE,
 			client_toggle_freeze },
@@ -412,6 +418,10 @@ xu_ewmh_restore_net_wm_state(struct client_ctx *cc)
 			client_toggle_fullscreen(cc);
 		if (atoms[i] == ewmh[_NET_WM_STATE_DEMANDS_ATTENTION])
 			client_urgency(cc);
+		if (atoms[i] == ewmh[_NET_WM_STATE_SKIP_PAGER])
+			client_toggle_skip_pager(cc);
+		if (atoms[i] == ewmh[_NET_WM_STATE_SKIP_TASKBAR])
+			client_toggle_skip_taskbar(cc);
 		if (atoms[i] == ewmh[_CWM_WM_STATE_FREEZE])
 			client_toggle_freeze(cc);
 	}
@@ -433,6 +443,8 @@ xu_ewmh_set_net_wm_state(struct client_ctx *cc)
 		    oatoms[i] != ewmh[_NET_WM_STATE_HIDDEN] &&
 		    oatoms[i] != ewmh[_NET_WM_STATE_FULLSCREEN] &&
 		    oatoms[i] != ewmh[_NET_WM_STATE_DEMANDS_ATTENTION] &&
+		    oatoms[i] != ewmh[_NET_WM_STATE_SKIP_PAGER] &&
+		    oatoms[i] != ewmh[_NET_WM_STATE_SKIP_TASKBAR] &&
 		    oatoms[i] != ewmh[_CWM_WM_STATE_FREEZE])
 			atoms[j++] = oatoms[i];
 	}
@@ -451,6 +463,10 @@ xu_ewmh_set_net_wm_state(struct client_ctx *cc)
 	}
 	if (cc->flags & CLIENT_URGENCY)
 		atoms[j++] = ewmh[_NET_WM_STATE_DEMANDS_ATTENTION];
+	if (cc->flags & CLIENT_SKIP_PAGER)
+		atoms[j++] = ewmh[_NET_WM_STATE_SKIP_PAGER];
+	if (cc->flags & CLIENT_SKIP_TASKBAR)
+		atoms[j++] = ewmh[_NET_WM_STATE_SKIP_TASKBAR];
 	if (cc->flags & CLIENT_FREEZE)
 		atoms[j++] = ewmh[_CWM_WM_STATE_FREEZE];
 	if (j > 0)