From 74996c097b03a57b19f03e55cc0920be7c5e3f87 Mon Sep 17 00:00:00 2001 From: Ivan Kanakarakis Date: Tue, 26 Jun 2012 20:08:03 +0300 Subject: rework mousemotion function return conditional --- monsterwm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'monsterwm.c') diff --git a/monsterwm.c b/monsterwm.c index 7214100..02e1812 100644 --- a/monsterwm.c +++ b/monsterwm.c @@ -539,9 +539,8 @@ void maprequest(XEvent *e) { * Ungrab the poitner and event handling is passed back to run() function. * Once a window has been moved or resized, it's marked as floating. */ void mousemotion(const Arg *arg) { - if (!curr) return; static XWindowAttributes wa; - if (!XGetWindowAttributes(dis, curr->win, &wa)) return; + if (!curr || !XGetWindowAttributes(dis, curr->win, &wa)) return; if (XGrabPointer(dis, root, False, BUTTONMASK|PointerMotionMask, GrabModeAsync, GrabModeAsync, None, None, CurrentTime) != GrabSuccess) return; -- cgit v1.3.1