From 418f3d0b37af2f3c57235e1af206a105983b137e Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Thu, 22 Jul 2010 09:23:13 +0200 Subject: [PATCH] Minor cleanup Or'ing into a bool feels dirty and the struct members should all be documented. Signed-off-by: Uli Schlachter --- screen.h | 1 + systray.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/screen.h b/screen.h index dc4c4b8c6..ae572b3b1 100644 --- a/screen.h +++ b/screen.h @@ -37,6 +37,7 @@ struct a_screen xcb_window_t window; /** Systray window parent */ xcb_window_t parent; + /** Is awesome the systray owner? */ bool registered; } systray; /** Previously focused client */ diff --git a/systray.c b/systray.c index a7b49414c..67b78399c 100644 --- a/systray.c +++ b/systray.c @@ -56,15 +56,15 @@ systray_init(int phys_screen) void systray_refresh() { - bool has_systray; int nscreen = xcb_setup_roots_length(xcb_get_setup(globalconf.connection)); for(int phys_screen = 0; phys_screen < nscreen; phys_screen++) { - has_systray = false; + bool has_systray = false; foreach(w, globalconf.wiboxes) - if(phys_screen == (*w)->ctx.phys_screen) - has_systray |= (*w)->has_systray; + if(phys_screen == (*w)->ctx.phys_screen && (*w)->has_systray) + /* Can't use "break" with foreach() :( */ + has_systray = true; if(has_systray) systray_register(phys_screen);