aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--monsterwm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/monsterwm.c b/monsterwm.c
index 92ed596..47bdfe1 100644
--- a/monsterwm.c
+++ b/monsterwm.c
@@ -159,7 +159,7 @@ void addwindow(Window w) {
void buttonpress(XEvent *e) {
if (CLICK_TO_FOCUS && e->xbutton.window != current->win && e->xbutton.button == Button1)
- for (current=head; current; current=current->next) if (e->xbutton.window == current->win) break;
+ for (current=head; current && current->win != e->xbutton.window; current=current->next);
if (!current) current = head;
update_current();
}