From a44da9fe8edf2fdec2edff3bee17fa159e6cc847 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 8 Nov 2009 11:03:56 +0100 Subject: [PATCH] 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 Signed-off-by: Julien Danjou --- objects/wibox.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/objects/wibox.c b/objects/wibox.c index 159c6034..a53462df 100644 --- a/objects/wibox.c +++ b/objects/wibox.c @@ -1010,10 +1010,12 @@ luaA_wibox_set_bg(lua_State *L, wibox_t *wibox) uint32_t values[] = { wibox->ctx.bg.pixel }; wibox->need_update = true; - xcb_change_window_attributes(globalconf.connection, - wibox->window, - mask, - values); + + if (wibox->window != XCB_NONE) + xcb_change_window_attributes(globalconf.connection, + wibox->window, + mask, + values); } luaA_object_emit_signal(L, -3, "property::bg", 0); return 0;