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:
parent
8ed6d60a25
commit
c912da0189
10
wibox.c
10
wibox.c
|
@ -1053,10 +1053,12 @@ luaA_wibox_set_bg(lua_State *L, wibox_t *wibox)
|
||||||
uint32_t values[] = { wibox->ctx.bg.pixel };
|
uint32_t values[] = { wibox->ctx.bg.pixel };
|
||||||
|
|
||||||
wibox->need_update = true;
|
wibox->need_update = true;
|
||||||
xcb_change_window_attributes(globalconf.connection,
|
|
||||||
wibox->window,
|
if (wibox->window != XCB_NONE)
|
||||||
mask,
|
xcb_change_window_attributes(globalconf.connection,
|
||||||
values);
|
wibox->window,
|
||||||
|
mask,
|
||||||
|
values);
|
||||||
}
|
}
|
||||||
luaA_object_emit_signal(L, -3, "property::bg", 0);
|
luaA_object_emit_signal(L, -3, "property::bg", 0);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue