gstglwindow_x11: fix resize
authorDavid Bender <benderdave@gitlab.fdo>
Thu, 11 Jun 2020 22:21:56 +0000 (00:21 +0200)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 12 Jun 2020 01:36:22 +0000 (01:36 +0000)
commitb4bdb75a800fb615ca20739ae8444b9b094a2b26
tree2f3dabc90f47d8e77e9bb475469d533665ad8483
parenta90968997a4d9644205ee61f7b13b524cc973bf1
gstglwindow_x11: fix resize

This patch was taken from #629#note_178766, the comment made
at the time was:

The root issue is a mismatch between the initialization of render_rect
in GstGLWindowX11Private and what's expected in the draw_cb function.
Because render_rect is not explicitly initialized to a width and height
of -1 (unlike gstglwindow_wayland_egl.c which does initialize to -1),
the less-than check for explicitly-set render_rect at gstglwindow_x11.c:453-454
always fails, even when the parent_win has been set and the render rectangle
has never been set.

Maybe this came from copying the similar check in the wayland code? Regardless,
I think the correct inequality should be '<= 0' (on both lines).

Alternatively initialization could be changed, but other sinks, e.g.
xvimagesink don't appear to use -1 to mean "unset" render_rect this way.

The issue can be reproduced by running the example in
tests/examples/gl/qt/videooverlay/ on X11, and resizing the output
window

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/701>
gst-libs/gst/gl/x11/gstglwindow_x11.c