wibox_position_update(): Skip wibox if wibox.screen is nil

If a wibox's screen is set to nil, this is reflected by setting the screen
struct member to SCREEN_UNDEF.
SCREEN_UNDEF is defined as -1. If we allow such a wibox in
wibox_position_update(), bad things will happen (globalconf.screens[-1]).

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2009-04-10 20:16:57 +02:00 committed by Julien Danjou
parent 67c96cbebc
commit 99a8dbeaf7
1 changed files with 6 additions and 0 deletions

View File

@ -295,6 +295,12 @@ wibox_position_update(wibox_t *wibox)
area_t area, wingeom = wibox->sw.geometry;
bool ignore = false;
/* Everything we do below needs the wibox' screen.
* No screen, nothing to do.
*/
if (wibox->screen == SCREEN_UNDEF)
return;
globalconf.screens[wibox->screen].need_arrange = true;
/* Place wibox'es at the edge of the screen, struts come later. */