<div dir="ltr">If you want to avoid the extra round trip, go down a level in XCB and send the get_geometry and frame_extents (and maybe whatever else) requests before looking for a response. This is the point of the cookie mechanism: don't wait around for data before sending unrelated requests.<br></div><br><div class="gmail_quote"><div dir="ltr">On Sun, Jul 5, 2015 at 5:08 AM Uli Schlachter <<a href="mailto:psychon@znc.in">psychon@znc.in</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Am 04.07.2015 um 18:12 schrieb Cosmin Apreutesei:<br>
>>> - xcb_get_geometry always returns the initial dimensions even after<br>
>>> the window gets resized (what gives?)<br>
>><br>
>> That makes no sense at all. Do you have a small example on this?<br>
>><br>
><br>
> Hi again Uli, thanks for answering.<br>
><br>
> It's a Lua backend for a cross-platform windowing lib[1] so I can't easily<br>
> make C examples.<br>
><br>
> Anyway, your skepticism made me look deeper and I finally found the<br>
> problem. I was enabling too many bits on the event mask, including<br>
> XCB_EVENT_MASK_RESIZE_REDIRECT which was causing the described behavior. I<br>
> was confident I did nothing wrong because of a note in the pyglet source<br>
> code saying the same thing about XGetGeometry, but apparently the author<br>
> fell into the same trap by coincidence. Sorry for the noise and thanks for<br>
> the help.<br>
<br>
Hey, that's a nice trick to make your window un-resizable. I have to remember<br>
that. :-)<br>
<br>
> About the 4.1.5 section of the ICCCM, I can do it that way but first I want<br>
> to ask: wouldn't the following stateless piece work too?<br>
><br>
> frame_rect(win) {<br>
>   x, y = xcb_translate_coords(win, screen.root, 0, 0)<br>
>   geom = xcb_get_geometry(win)<br>
>   w, h = geom.width, geom.height<br>
>   w1, h1, w2, h2 = xcb_frame_extents(win)<br>
>   return x - w1, y - h1, w + w2, h + h2<br>
> }<br>
<br>
Yup, I guess this would work. However, ICCCM tries to avoid a round-trip. I<br>
don't think worrying about a single round-trip being slow is that important<br>
these days.<br>
<br>
So yeah, the above code is fine with me.<br>
<br>
> This assumes the wm gives frame extents -- are there known wms that don't?<br>
[...]<br>
<br>
Any WM that doesn't implement EWMH or just doesn't implement this part of EWMH.<br>
Any WM that doesn't have window decorations. (dwm? i3wm? awesome?)<br>
<br>
Cheers,<br>
Uli<br>
<br>
P.S.: I guess I should eventually fix awesome to implement this bit of EWMH...<br>
--<br>
99 little bugs in the code<br>
99 little bugs in the code<br>
Take one down, patch it around<br>
117 little bugs in the code<br>
  -- @irqed<br>
_______________________________________________<br>
Xcb mailing list<br>
<a href="mailto:Xcb@lists.freedesktop.org" target="_blank">Xcb@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/xcb" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/xcb</a></blockquote></div>