statusbar: add statusbar_getbywin()

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-08-25 13:32:26 +02:00
parent 5d841ee386
commit da9de6938d
2 changed files with 16 additions and 0 deletions

View File

@ -228,6 +228,21 @@ statusbar_draw(statusbar_t *statusbar)
statusbar_systray_refresh(statusbar);
}
/** Get a statusbar by its window.
* \param w The window id.
* \return A statusbar if found, NULL otherwise.
*/
statusbar_t *
statusbar_getbywin(xcb_window_t w)
{
statusbar_t *s;
for(int i = 0; i < globalconf.screens_info->nscreen; i++)
for(s = globalconf.screens[i].statusbar; s; s = s->next)
if(s->sw->window == w)
return s;
return NULL;
}
/** Statusbar refresh function.
*/
void

View File

@ -35,6 +35,7 @@ statusbar_delete(statusbar_t **statusbar)
p_delete(statusbar);
}
statusbar_t * statusbar_getbywin(xcb_window_t);
void statusbar_refresh(void);
void statusbar_position_update(statusbar_t *);