x11: Update GL viewport on ConfigureNotify

On X11, by virtue of the asynchronous nature of the protocol, we have to
wait until the ConfigureNotify event to resize the GL viewport. If the
GdkWindow is a top-level one, then we'll get a GDK_CONFIGURE event, but
if we're using a GDK_WINDOW_CHILD the event will be dropped on the
floor.
This commit is contained in:
Emmanuele Bassi
2014-08-11 21:29:00 +01:00
parent 90cc7743d0
commit 686f9b4607

View File

@@ -782,11 +782,27 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
}
#endif
if (!window ||
xevent->xconfigure.event != xevent->xconfigure.window ||
GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD ||
if (!window ||
xevent->xconfigure.event != xevent->xconfigure.window ||
GDK_WINDOW_TYPE (window) == GDK_WINDOW_ROOT)
return_val = FALSE;
{
return_val = FALSE;
}
else if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD)
{
/* on X11 we need to wait until a ConfigureNotify before
* updating the GL viewport, otherwise the GLX drawable
* and the X drawable will go out of sync.
*/
if (gdk_window_has_gl_context (window))
{
GdkGLContext *context = gdk_window_get_gl_context (window);
gdk_gl_context_update (context);
}
return_val = FALSE;
}
else
{
event->configure.type = GDK_CONFIGURE;