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 34d4cce4ac
commit e6a1f8bac9
1 changed files with 2 additions and 1 deletions

View File

@ -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)))