From e6a1f8bac9cffaeb64006e68160ec4ceb5a20688 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Mon, 29 Mar 2010 11:21:20 +0200 Subject: [PATCH] Use WM_STATE_NORMAL as default If a window didn't have a WM_STATE set, xwindow_get_state_reply() returned 0 which just happened to be XCB_WM_STATE_WITHDRAWN. This caused issues in scan(). Instead, we now assume a window is in state normal if no state is explicitly set, which makes a lot more sense and fixes actual bugs. Signed-off-by: Uli Schlachter Signed-off-by: Julien Danjou --- window.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/window.c b/window.c index 5e9c7346..c87ed04a 100644 --- a/window.c +++ b/window.c @@ -59,7 +59,8 @@ window_state_get_unchecked(xcb_window_t w) uint32_t window_state_get_reply(xcb_get_property_cookie_t cookie) { - uint32_t result = 0; + /* If no property is set, we just assume a sane default. */ + uint32_t result = XCB_WM_STATE_NORMAL; xcb_get_property_reply_t *prop_r; if((prop_r = xcb_get_property_reply(globalconf.connection, cookie, NULL)))