$OpenBSD: patch-src_manage_c,v 1.5 2012/01/20 15:53:18 dcoppa Exp $

Bugfix: respect WM_HINTS.input for WM_TAKE_FOCUS clients. This fixes
problems with some Qt apps
(upstream git commit 2d14ced024416e2074b57290bf7dade7d08899e5)

--- src/manage.c.orig	Sat Dec 24 16:25:08 2011
+++ src/manage.c	Fri Jan 20 14:29:55 2012
@@ -80,7 +80,7 @@ void manage_window(xcb_window_t window, xcb_get_window
     xcb_get_property_cookie_t wm_type_cookie, strut_cookie, state_cookie,
                               utf8_title_cookie, title_cookie,
                               class_cookie, leader_cookie, transient_cookie,
-                              role_cookie, startup_id_cookie;
+                              role_cookie, startup_id_cookie, wm_hints_cookie;
 
 
     geomc = xcb_get_geometry(conn, d);
@@ -142,6 +142,7 @@ void manage_window(xcb_window_t window, xcb_get_window
     class_cookie = GET_PROPERTY(XCB_ATOM_WM_CLASS, 128);
     role_cookie = GET_PROPERTY(A_WM_WINDOW_ROLE, 128);
     startup_id_cookie = GET_PROPERTY(A__NET_STARTUP_ID, 512);
+    wm_hints_cookie = xcb_icccm_get_wm_hints(conn, window);
     /* TODO: also get wm_normal_hints here. implement after we got rid of xcb-event */
 
     DLOG("Managing window 0x%08x\n", window);
@@ -169,6 +170,7 @@ void manage_window(xcb_window_t window, xcb_get_window
     window_update_transient_for(cwindow, xcb_get_property_reply(conn, transient_cookie, NULL));
     window_update_strut_partial(cwindow, xcb_get_property_reply(conn, strut_cookie, NULL));
     window_update_role(cwindow, xcb_get_property_reply(conn, role_cookie, NULL), true);
+    window_update_hints(cwindow, xcb_get_property_reply(conn, wm_hints_cookie, NULL));
 
     xcb_get_property_reply_t *startup_id_reply;
     startup_id_reply = xcb_get_property_reply(conn, startup_id_cookie, NULL);
