Skip to content

gstglwindow_x11: fix resize

This patch was taken from #629 (closed)#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

Merge request reports