wibox: check if a wibox' window exists before modifying it

If you change the .bg of an existing wibox which isn't attached to any screen
yet, then there is no window for which we can update the XCB_CW_BACK_PIXEL.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Uli Schlachter 2009-11-08 11:03:56 +01:00 committed by Julien Danjou
parent 056d9a074b
commit a44da9fe8e
1 changed files with 6 additions and 4 deletions

View File

@ -1010,6 +1010,8 @@ luaA_wibox_set_bg(lua_State *L, wibox_t *wibox)
uint32_t values[] = { wibox->ctx.bg.pixel };
wibox->need_update = true;
if (wibox->window != XCB_NONE)
xcb_change_window_attributes(globalconf.connection,
wibox->window,
mask,