From 4d6d63ff0a2fdb9e4bd955e4a2fae8e4597b253b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Tue, 20 Dec 2016 17:54:14 +0200 Subject: [PATCH] tcuX11: fix to wait for matching ConfigureNotify Patch changes loop in setDimensions to spin until exact matching ConfigureNotify event was caught. This makes sure that we don't catch something that was in the event queue earlier and conclude that as event triggered by our resize. --- framework/platform/X11/tcuX11.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/framework/platform/X11/tcuX11.cpp b/framework/platform/X11/tcuX11.cpp index c60c95e..804f3d0 100644 --- a/framework/platform/X11/tcuX11.cpp +++ b/framework/platform/X11/tcuX11.cpp @@ -227,6 +227,16 @@ void Window::setDimensions (int width, int height) changes.height = height; XConfigureWindow(m_display.getXDisplay(), m_window, mask, &changes); + for(;;) + { + XEvent myevent; + XNextEvent(m_display.getXDisplay(), &myevent); + if (myevent.type == ConfigureNotify) { + XConfigureEvent e = myevent.xconfigure; + if (e.width == width && e.height == height) + break; + } + } } void Window::processEvents (void) -- 2.5.5