From d18f17b8c94d882b25af1e9cb8394ecf182b7ecd Mon Sep 17 00:00:00 2001 From: Ivan Kanakarakis Date: Thu, 5 Jan 2012 17:45:01 +0200 Subject: rework clientmessage() function --- monsterwm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/monsterwm.c b/monsterwm.c index 5727a7b..0fd6379 100644 --- a/monsterwm.c +++ b/monsterwm.c @@ -215,10 +215,10 @@ void client_to_desktop(const Arg *arg) { * three actions: remove/unset _NET_WM_STATE_REMOVE=0, add/set _NET_WM_STATE_ADD=1, toggle _NET_WM_STATE_TOGGLE=2 */ void clientmessage(XEvent *e) { - client *c; - if (!(c = wintoclient(e->xclient.window)) || e->xclient.message_type != netatoms[NET_WM_STATE] || ((unsigned)e->xclient.data.l[1] - != netatoms[NET_FULLSCREEN] && (unsigned)e->xclient.data.l[2] != netatoms[NET_FULLSCREEN])) return; - setfullscreen(c, (e->xclient.data.l[0] == 1 || (e->xclient.data.l[0] == 2 && !c->isfullscreen))); + client *c = wintoclient(e->xclient.window); + if (c && e->xclient.message_type == netatoms[NET_WM_STATE] && ((unsigned)e->xclient.data.l[1] + == netatoms[NET_FULLSCREEN] || (unsigned)e->xclient.data.l[2] == netatoms[NET_FULLSCREEN])) + setfullscreen(c, (e->xclient.data.l[0] == 1 || (e->xclient.data.l[0] == 2 && !c->isfullscreen))); tile(); update_current(); } -- cgit v1.3.1