[statusbar] Fix potential error if statusbar is Off on start

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-05-27 15:15:48 +02:00
parent a0b24c5505
commit 05bb1d3833
1 changed files with 4 additions and 3 deletions

View File

@ -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;