[Piglit] [PATCH] util/x11: Propagate window resize events to piglit_width/height

Eric Anholt eric at anholt.net
Mon Oct 21 20:59:57 CEST 2013


Chad Versace <chad.versace at linux.intel.com> writes:

> On 10/18/2013 05:19 PM, Eric Anholt wrote:
>> Chad Versace <chad.versace at linux.intel.com> writes:
>>
>>> When I switched Piglit from GLUT to Waffle, I broke detection of X11
>>> window resizes. When the user resized the window, Piglit called
>>> piglit_display() but neglected to update piglit_width/height.
>>>
>>> This patch ensures that Piglit updates piglit_width/height correctly.
>>>
>>> (It's amazing that it took this long for anyone to fix it. People must
>>> rarely resize Piglit windows).
>>
>> ConfigureNotify tells you the new size.  And I'm not clear why you'd
>> need to update the size at Expose time.
>
> I admit that I don't understand X protocol. I knew that ConfigureNotify
> tells us the size, and I was unsure if Expose did also. So I played it
> safe and updated the size on both events.
>
> So, the size update on Event needs to get removed.
>
> Is there a cleaner way to get the window size from the ConfigureNotify
> event than calling XGetGeometry?

ConfigureNotify tells you the correct new size of the window
(event.xconfigure.width/height, visible in the hunk of the patch you
proposed), and we just need to update piglit_width/height with it.  You
don't need to update other times, because at other times you would have
had a configurenotify anyway.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20131021/06bcf792/attachment.pgp>


More information about the Piglit mailing list