diff options
author | okan | 2017-12-19 14:30:53 +0000 |
---|---|---|
committer | okan | 2017-12-19 14:30:53 +0000 |
commit | 51864faa7356c0dc3bf6b7eed8a904f2023d2b8d (patch) | |
tree | 74f47a63bc3daa1258f881f1c8721b5656af7d5f | |
parent | 27ae8bb8e754cc296f0bec61934f1a13e6bf32c0 (diff) | |
download | cwm-51864faa7356c0dc3bf6b7eed8a904f2023d2b8d.tar.gz |
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.
-rw-r--r-- | calmwm.h | 13 | ||||
-rw-r--r-- | client.c | 18 | ||||
-rw-r--r-- | conf.c | 4 | ||||
-rw-r--r-- | xutil.c | 18 |
4 files changed, 47 insertions, 6 deletions
@@ -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: calmwm.h,v 1.346 2017/12/15 13:13:17 okan Exp $ + * $OpenBSD: calmwm.h,v 1.347 2017/12/19 14:30:53 okan Exp $ */ #ifndef _CALMWM_H_ @@ -155,6 +155,11 @@ struct client_ctx { #define CLIENT_FULLSCREEN 0x0800 #define CLIENT_STICKY 0x1000 #define CLIENT_ACTIVE 0x2000 +#define CLIENT_SKIP_PAGER 0x4000 +#define CLIENT_SKIP_TASKBAR 0x8000 + +#define CLIENT_SKIP_CYCLE (CLIENT_HIDDEN | CLIENT_IGNORE | \ + CLIENT_SKIP_TASKBAR | CLIENT_SKIP_PAGER) #define CLIENT_HIGHLIGHT (CLIENT_GROUP | CLIENT_UNGROUP) #define CLIENT_MAXFLAGS (CLIENT_VMAXIMIZED | CLIENT_HMAXIMIZED) #define CLIENT_MAXIMIZED (CLIENT_VMAXIMIZED | CLIENT_HMAXIMIZED) @@ -353,13 +358,15 @@ enum ewmh { _NET_WM_DESKTOP, _NET_CLOSE_WINDOW, _NET_WM_STATE, -#define _NET_WM_STATES_NITEMS 7 +#define _NET_WM_STATES_NITEMS 9 _NET_WM_STATE_STICKY, _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_HIDDEN, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_DEMANDS_ATTENTION, + _NET_WM_STATE_SKIP_PAGER, + _NET_WM_STATE_SKIP_TASKBAR, _CWM_WM_STATE_FREEZE, EWMH_NITEMS }; @@ -411,6 +418,8 @@ void client_toggle_fullscreen(struct client_ctx *); void client_toggle_hidden(struct client_ctx *); void client_toggle_hmaximize(struct client_ctx *); void client_toggle_maximize(struct client_ctx *); +void client_toggle_skip_pager(struct client_ctx *); +void client_toggle_skip_taskbar(struct client_ctx *); void client_toggle_sticky(struct client_ctx *); void client_toggle_vmaximize(struct client_ctx *); void client_transient(struct client_ctx *); @@ -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: client.c,v 1.240 2017/05/05 14:14:19 okan Exp $ + * $OpenBSD: client.c,v 1.241 2017/12/19 14:30:53 okan Exp $ */ #include <sys/types.h> @@ -266,6 +266,20 @@ client_toggle_hidden(struct client_ctx *cc) } void +client_toggle_skip_pager(struct client_ctx *cc) +{ + cc->flags ^= CLIENT_SKIP_PAGER; + xu_ewmh_set_net_wm_state(cc); +} + +void +client_toggle_skip_taskbar(struct client_ctx *cc) +{ + cc->flags ^= CLIENT_SKIP_TASKBAR; + xu_ewmh_set_net_wm_state(cc); +} + +void client_toggle_sticky(struct client_ctx *cc) { cc->flags ^= CLIENT_STICKY; @@ -688,7 +702,7 @@ client_cycle(struct screen_ctx *sc, int flags) client_next(newcc); /* Only cycle visible and non-ignored windows. */ - if ((newcc->flags & (CLIENT_HIDDEN | CLIENT_IGNORE)) + if ((newcc->flags & (CLIENT_SKIP_CYCLE)) || ((flags & CWM_CYCLE_INGROUP) && (newcc->gc != oldcc->gc))) again = 1; @@ -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: conf.c,v 1.235 2017/12/07 16:25:33 okan Exp $ + * $OpenBSD: conf.c,v 1.236 2017/12/19 14:30:53 okan Exp $ */ #include <sys/types.h> @@ -720,6 +720,8 @@ static char *ewmhints[] = { "_NET_WM_STATE_HIDDEN", "_NET_WM_STATE_FULLSCREEN", "_NET_WM_STATE_DEMANDS_ATTENTION", + "_NET_WM_STATE_SKIP_PAGER", + "_NET_WM_STATE_SKIP_TASKBAR", "_CWM_WM_STATE_FREEZE", }; @@ -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.108 2016/10/05 13:10:59 okan Exp $ + * $OpenBSD: xutil.c,v 1.109 2017/12/19 14:30:53 okan Exp $ */ #include <sys/types.h> @@ -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) |