aboutsummaryrefslogtreecommitdiffstats
path: root/xutil.c
diff options
context:
space:
mode:
authorokan2014-09-17 16:00:44 +0000
committerokan2014-09-17 16:00:44 +0000
commit8d10d477be60c717703bb419601c8c76be754f54 (patch)
tree7220a1ddb8d474e982345b775f4006c8c63f271d /xutil.c
parent67e11ccf55b1c98c1db978ca29a41a2fdd71e061 (diff)
downloadcwm-8d10d477be60c717703bb419601c8c76be754f54.tar.gz
Implement EWMH _NET_WM_STATE_HIDDEN.
Diffstat (limited to '')
-rw-r--r--xutil.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/xutil.c b/xutil.c
index 6eb2b17..1ba435e 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.93 2014/09/15 13:00:49 okan Exp $
+ * $OpenBSD: xutil.c,v 1.94 2014/09/17 16:00:44 okan Exp $
*/
#include <sys/param.h>
@@ -379,6 +379,9 @@ xu_ewmh_handle_net_wm_state_msg(struct client_ctx *cc, int action,
{ _NET_WM_STATE_MAXIMIZED_HORZ,
CLIENT_HMAXIMIZED,
client_hmaximize },
+ { _NET_WM_STATE_HIDDEN,
+ CLIENT_HIDDEN,
+ client_hidden },
{ _NET_WM_STATE_FULLSCREEN,
CLIENT_FULLSCREEN,
client_fullscreen },
@@ -420,6 +423,8 @@ xu_ewmh_restore_net_wm_state(struct client_ctx *cc)
client_hmaximize(cc);
if (atoms[i] == ewmh[_NET_WM_STATE_MAXIMIZED_VERT])
client_vmaximize(cc);
+ if (atoms[i] == ewmh[_NET_WM_STATE_HIDDEN])
+ client_hidden(cc);
if (atoms[i] == ewmh[_NET_WM_STATE_FULLSCREEN])
client_fullscreen(cc);
if (atoms[i] == ewmh[_NET_WM_STATE_DEMANDS_ATTENTION])
@@ -437,16 +442,19 @@ xu_ewmh_set_net_wm_state(struct client_ctx *cc)
oatoms = xu_ewmh_get_net_wm_state(cc, &n);
atoms = xcalloc((n + _NET_WM_STATES_NITEMS), sizeof(Atom));
for (i = j = 0; i < n; i++) {
- if (oatoms[i] != ewmh[_NET_WM_STATE_MAXIMIZED_HORZ] &&
+ if (oatoms[i] != ewmh[_NET_WM_STATE_STICKY] &&
+ oatoms[i] != ewmh[_NET_WM_STATE_MAXIMIZED_HORZ] &&
oatoms[i] != ewmh[_NET_WM_STATE_MAXIMIZED_VERT] &&
+ oatoms[i] != ewmh[_NET_WM_STATE_HIDDEN] &&
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_HIDDEN)
+ atoms[j++] = ewmh[_NET_WM_STATE_HIDDEN];
if (cc->flags & CLIENT_FULLSCREEN)
atoms[j++] = ewmh[_NET_WM_STATE_FULLSCREEN];
else {