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 <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Uli Schlachter 2010-03-29 11:21:20 +02:00 committed by Julien Danjou
parent 5c232572a3
commit ac4c788fd9

View file

@ -59,7 +59,8 @@ xwindow_get_state_unchecked(xcb_window_t w)
uint32_t
xwindow_get_state_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)))