statusbar: add statusbar_getbywin()
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
5d841ee386
commit
da9de6938d
15
statusbar.c
15
statusbar.c
|
@ -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
|
||||
|
|
|
@ -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 *);
|
||||
|
||||
|
|
Loading…
Reference in New Issue