$OpenBSD: patch-property_c,v 1.3 2013/06/28 12:45:38 dcoppa Exp $

Revert to the old xcb-util-0.3.6 API

commit 14722aa6e43f7108eddceb1306c3d5f91cb538e9
Author: Uli Schlachter <psychon@znc.in>
Date:   Wed Jun 19 19:23:19 2013 +0200

Fix WM_CLIENT_LEADER handling

This was broken since 5d0a81c8bf48. Whoops.

Signed-off-by: Uli Schlachter <psychon@znc.in>

--- property.c.orig	Mon Apr  1 13:44:46 2013
+++ property.c	Fri Jun 28 14:20:15 2013
@@ -98,7 +98,7 @@ HANDLE_PROPERTY(net_wm_pid)
 xcb_get_property_cookie_t
 property_get_wm_transient_for(client_t *c)
 {
-    return xcb_icccm_get_wm_transient_for_unchecked(globalconf.connection, c->window);
+    return xcb_get_wm_transient_for_unchecked(globalconf.connection, c->window);
 }
 
 void
@@ -106,7 +106,7 @@ property_update_wm_transient_for(client_t *c, xcb_get_
 {
     xcb_window_t trans;
 
-    if(!xcb_icccm_get_wm_transient_for_reply(globalconf.connection,
+    if(!xcb_get_wm_transient_for_reply(globalconf.connection,
 					     cookie,
 					     &trans, NULL))
             return;
@@ -122,7 +122,7 @@ xcb_get_property_cookie_t
 property_get_wm_client_leader(client_t *c)
 {
     return xcb_get_property_unchecked(globalconf.connection, false, c->window,
-                                      WM_CLIENT_LEADER, XCB_ATOM_WINDOW, 1, 32);
+                                      WM_CLIENT_LEADER, XCB_ATOM_WINDOW, 0, 32);
 }
 
 /** Update leader hint of a client.
@@ -146,7 +146,7 @@ property_update_wm_client_leader(client_t *c, xcb_get_
 xcb_get_property_cookie_t
 property_get_wm_normal_hints(client_t *c)
 {
-    return xcb_icccm_get_wm_normal_hints_unchecked(globalconf.connection, c->window);
+    return xcb_get_wm_normal_hints_unchecked(globalconf.connection, c->window);
 }
 
 /** Update the size hints of a client.
@@ -156,7 +156,7 @@ property_get_wm_normal_hints(client_t *c)
 void
 property_update_wm_normal_hints(client_t *c, xcb_get_property_cookie_t cookie)
 {
-    xcb_icccm_get_wm_normal_hints_reply(globalconf.connection,
+    xcb_get_wm_normal_hints_reply(globalconf.connection,
 					cookie,
 					&c->size_hints, NULL);
 }
@@ -164,7 +164,7 @@ property_update_wm_normal_hints(client_t *c, xcb_get_p
 xcb_get_property_cookie_t
 property_get_wm_hints(client_t *c)
 {
-    return xcb_icccm_get_wm_hints_unchecked(globalconf.connection, c->window);
+    return xcb_get_wm_hints_unchecked(globalconf.connection, c->window);
 }
 
 /** Update the WM hints of a client.
@@ -174,20 +174,20 @@ property_get_wm_hints(client_t *c)
 void
 property_update_wm_hints(client_t *c, xcb_get_property_cookie_t cookie)
 {
-    xcb_icccm_wm_hints_t wmh;
+    xcb_wm_hints_t wmh;
 
-    if(!xcb_icccm_get_wm_hints_reply(globalconf.connection,
+    if(!xcb_get_wm_hints_reply(globalconf.connection,
 				     cookie,
 				     &wmh, NULL))
         return;
 
     luaA_object_push(globalconf.L, c);
-    client_set_urgent(globalconf.L, -1, xcb_icccm_wm_hints_get_urgency(&wmh));
+    client_set_urgent(globalconf.L, -1, xcb_wm_hints_get_urgency(&wmh));
 
-    if(wmh.flags & XCB_ICCCM_WM_HINT_INPUT)
+    if(wmh.flags & XCB_WM_HINT_INPUT)
         c->nofocus = !wmh.input;
 
-    if(wmh.flags & XCB_ICCCM_WM_HINT_WINDOW_GROUP)
+    if(wmh.flags & XCB_WM_HINT_WINDOW_GROUP)
         client_set_group_window(globalconf.L, -1, wmh.window_group);
 
     lua_pop(globalconf.L, 1);
@@ -196,7 +196,7 @@ property_update_wm_hints(client_t *c, xcb_get_property
 xcb_get_property_cookie_t
 property_get_wm_class(client_t *c)
 {
-    return xcb_icccm_get_wm_class_unchecked(globalconf.connection, c->window);
+    return xcb_get_wm_class_unchecked(globalconf.connection, c->window);
 }
 
 /** Update WM_CLASS of a client.
@@ -206,9 +206,9 @@ property_get_wm_class(client_t *c)
 void
 property_update_wm_class(client_t *c, xcb_get_property_cookie_t cookie)
 {
-    xcb_icccm_get_wm_class_reply_t hint;
+    xcb_get_wm_class_reply_t hint;
 
-    if(!xcb_icccm_get_wm_class_reply(globalconf.connection,
+    if(!xcb_get_wm_class_reply(globalconf.connection,
 				     cookie,
 				     &hint, NULL))
         return;
@@ -217,7 +217,7 @@ property_update_wm_class(client_t *c, xcb_get_property
     client_set_class_instance(globalconf.L, -1, hint.class_name, hint.instance_name);
     lua_pop(globalconf.L, 1);
 
-    xcb_icccm_get_wm_class_reply_wipe(&hint);
+    xcb_get_wm_class_reply_wipe(&hint);
 }
 
 static int
@@ -280,7 +280,7 @@ property_update_net_wm_pid(client_t *c, xcb_get_proper
 xcb_get_property_cookie_t
 property_get_wm_protocols(client_t *c)
 {
-    return xcb_icccm_get_wm_protocols_unchecked(globalconf.connection,
+    return xcb_get_wm_protocols_unchecked(globalconf.connection,
 						c->window, WM_PROTOCOLS);
 }
 
@@ -291,15 +291,15 @@ property_get_wm_protocols(client_t *c)
 void
 property_update_wm_protocols(client_t *c, xcb_get_property_cookie_t cookie)
 {
-    xcb_icccm_get_wm_protocols_reply_t protocols;
+    xcb_get_wm_protocols_reply_t protocols;
 
     /* If this fails for any reason, we still got the old value */
-    if(!xcb_icccm_get_wm_protocols_reply(globalconf.connection,
+    if(!xcb_get_wm_protocols_reply(globalconf.connection,
 					 cookie,
 					 &protocols, NULL))
         return;
 
-    xcb_icccm_get_wm_protocols_reply_wipe(&c->protocols);
+    xcb_get_wm_protocols_reply_wipe(&c->protocols);
     memcpy(&c->protocols, &protocols, sizeof(protocols));
 }
 
