diff options
| author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2012-06-30 20:09:26 +0300 |
|---|---|---|
| committer | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2012-07-20 18:52:12 +0300 |
| commit | 0f8481343f6bdb2f3b13f258d951ec154f8ac79f (patch) | |
| tree | bd4b6fe3179535e0a2952e37c1164a040c921850 | |
| parent | d2709c0e2cb852a1e4efc25183843b54993eb951 (diff) | |
rework buttonpress function - get rid of return stament
| -rw-r--r-- | monsterwm.c | 6 |
1 files 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); |
