From 05bb1d38336722ef8d8abe8858fdf72511cad8cc Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 27 May 2008 15:15:48 +0200 Subject: [PATCH] [statusbar] Fix potential error if statusbar is Off on start Signed-off-by: Julien Danjou --- event.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/event.c b/event.c index 7c018eee6..16d312c5e 100644 --- a/event.c +++ b/event.c @@ -84,7 +84,8 @@ event_handle_buttonpress(void *data __attribute__ ((unused)), for(screen = 0; screen < globalconf.screens_info->nscreen; screen++) for(statusbar = globalconf.screens[screen].statusbar; statusbar; statusbar = statusbar->next) - if(statusbar->sw->window == ev->event || statusbar->sw->window == ev->child) + if(statusbar->sw + && (statusbar->sw->window == ev->event || statusbar->sw->window == ev->child)) { /* If the statusbar is child, then x,y are * relative to root window */ @@ -346,8 +347,8 @@ event_handle_expose(void *data __attribute__ ((unused)), { for(screen = 0; screen < globalconf.screens_info->nscreen; screen++) for(statusbar = globalconf.screens[screen].statusbar; statusbar; statusbar = statusbar->next) - if(statusbar->sw->window == ev->window - && statusbar->position) + if(statusbar->sw + && statusbar->sw->window == ev->window) { simplewindow_refresh_drawable(statusbar->sw); return 0;