From 0f8481343f6bdb2f3b13f258d951ec154f8ac79f Mon Sep 17 00:00:00 2001 From: Ivan Kanakarakis Date: Sat, 30 Jun 2012 20:09:26 +0300 Subject: rework buttonpress function - get rid of return stament --- monsterwm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/monsterwm.c b/monsterwm.c index 519100c..9a284bc 100644 --- a/monsterwm.c +++ b/monsterwm.c @@ -194,10 +194,8 @@ Client* addwindow(Window w) { /* on the press of a button check to see if there's a binded function to call */ void buttonpress(XEvent *e) { Client *c = wintoclient(e->xbutton.window); - if (!c) return; - if (CLICK_TO_FOCUS && curr != c && e->xbutton.button == Button1) focus(c); - - for (unsigned int i = 0; i < LENGTH(buttons); i++) + if (c && CLICK_TO_FOCUS && curr != c && e->xbutton.button == Button1) focus(c); + for (unsigned int i = 0; c && i < LENGTH(buttons); i++) if (CLEANMASK(buttons[i].mask) == CLEANMASK(e->xbutton.state) && buttons[i].button == e->xbutton.button) { if (curr != c) focus(c); -- cgit v1.3.1