diff --git a/event.c b/event.c index 15aee30c..44ce3418 100644 --- a/event.c +++ b/event.c @@ -365,9 +365,10 @@ 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) + if(statusbar->sw->window == ev->window + && statusbar->position) { - statusbar_display(statusbar); + simplewindow_refresh_drawable(statusbar->sw); return 0; } diff --git a/statusbar.c b/statusbar.c index 119a166d..03a3569e 100644 --- a/statusbar.c +++ b/statusbar.c @@ -113,6 +113,9 @@ statusbar_draw(Statusbar *statusbar) int left = 0, right = 0; area_t rectangle = { 0, 0, 0, 0, NULL, NULL }; + if(!statusbar->position) + return; + rectangle.width = statusbar->width; rectangle.height = statusbar->height; draw_rectangle(statusbar->ctx, rectangle, 1.0, true, @@ -158,15 +161,7 @@ statusbar_draw(Statusbar *statusbar) break; } - statusbar_display(statusbar); -} - -void -statusbar_display(Statusbar *statusbar) -{ - /* don't waste our time */ - if(statusbar->position != Off) - simplewindow_refresh_drawable(statusbar->sw); + simplewindow_refresh_drawable(statusbar->sw); } void diff --git a/statusbar.h b/statusbar.h index c091fb7f..28013ca7 100644 --- a/statusbar.h +++ b/statusbar.h @@ -27,7 +27,6 @@ void statusbar_refresh(void); void statusbar_preinit(Statusbar *); void statusbar_init(Statusbar *); -void statusbar_display(Statusbar *); Statusbar * statusbar_getbyname(int, const char *); Uicb uicb_statusbar_toggle;