From 8715025216658e92699f4e8eb7824c1cb18b8064 Mon Sep 17 00:00:00 2001 From: Ivan Kanakarakis Date: Sun, 8 Jan 2012 21:25:14 +0200 Subject: a shorter loop for buttonpress() function --- monsterwm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); } -- cgit v1.3.1