patch for xcb-util

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

patch for xcb-util

David Coppa
Hello,

I'd really like to have this in: are there any objections?

I'm resending, just in case it got lost.

Thanks,
david


Index: icccm.c
===================================================================
RCS file: /cvs/xenocara/dist/xcb-util/icccm/icccm.c,v
retrieving revision 1.5
diff -N -u -p icccm.c
--- icccm.c 7 Mar 2010 15:51:34 -0000 1.5
+++ icccm.c 16 Mar 2010 09:01:39 -0000
@@ -58,7 +58,7 @@ xcb_get_text_property_reply(xcb_connection_t *c,
 {
   xcb_get_property_reply_t *reply = xcb_get_property_reply(c, cookie, e);
 
-  if(!reply)
+  if(!reply || reply->type == XCB_NONE)
     return 0;
 
   prop->_reply = reply;
@@ -418,8 +418,7 @@ xcb_get_property_cookie_t
 xcb_get_wm_size_hints(xcb_connection_t *c, xcb_window_t window,
                       xcb_atom_t property)
 {
-  /* NumPropSizeElements = 18 (ICCCM version 1). */
-  return xcb_get_property(c, 0, window, property, WM_SIZE_HINTS, 0L, 18);
+  return xcb_get_property(c, 0, window, property, WM_SIZE_HINTS, 0L, XCB_NUM_WM_SIZE_HINTS_ELEMENTS);
 }
 
 xcb_get_property_cookie_t
@@ -427,7 +426,7 @@ xcb_get_wm_size_hints_unchecked(xcb_connection_t *c, x
                                 xcb_atom_t property)
 {
   return xcb_get_property_unchecked(c, 0, window, property, WM_SIZE_HINTS,
-                                    0L, 18);
+                                    0L, XCB_NUM_WM_SIZE_HINTS_ELEMENTS);
 }
 
 uint8_t
@@ -439,13 +438,11 @@ xcb_get_wm_size_hints_from_reply(xcb_size_hints_t *hin
   if(!reply)
     return 0;
 
-  length = xcb_get_property_value_length(reply) / (reply->format / 8);
-
   if (!(reply->type == WM_SIZE_HINTS &&
-         reply->format == 32 &&
-        /* OldNumPropSizeElements = 15 (pre-ICCCM) */
-        length >= 15))
+         reply->format == 32))
     return 0;
+
+  length = xcb_get_property_value_length(reply) / (reply->format / 8);
 
   if (length > XCB_NUM_WM_SIZE_HINTS_ELEMENTS)
     length = XCB_NUM_WM_SIZE_HINTS_ELEMENTS;

Reply | Threaded
Open this post in threaded view
|

Re: patch for xcb-util

Matthieu Herrb
On Tue, Mar 16, 2010 at 10:20:23AM +0100, David Coppa wrote:
> Hello,
>
> I'd really like to have this in: are there any objections?
>
> I'm resending, just in case it got lost.

No I got it. But it's really too late for 4.7. It will go in after
unlock. (And hopefully as a part of a new xcb-utils release).
--
Matthieu Herrb

Reply | Threaded
Open this post in threaded view
|

Re: patch for xcb-util

David Coppa
On Tue, Mar 16, 2010 at 11:00 AM, Matthieu Herrb <[hidden email]> wrote:

> No I got it. But it's really too late for 4.7. It will go in after
> unlock. (And hopefully as a part of a new xcb-utils release).

OK!
Thank you, Matthieu.

My patch is already in upstream git, but I don't know when a new
stable release of xcb-util will come out.

cheers,
David