x11: Fix deadlock

When waiting for a window's MapNotify event, drain only that window's
event queue.  Do NOT drain the global event queue, which includes all
windows' events.

Fixes deadlock in test 'dEQP-EGL.functional.multithread.window_context'
on Mesa master@f57bdd48 with Intel Skylake.

Change-Id: I8c7f2db6c145f59493cb7572b20c4799e9a2cd0a
Depends-On: Ib3b535cec8295e062994fd759ae083c78641cf13
diff --git a/framework/platform/X11/tcuX11.cpp b/framework/platform/X11/tcuX11.cpp
index c60c95e..d58ef63 100644
--- a/framework/platform/X11/tcuX11.cpp
+++ b/framework/platform/X11/tcuX11.cpp
@@ -200,7 +200,7 @@
 
 	do
 	{
-		XNextEvent(dpy, &event);
+		XWindowEvent(dpy, m_window, ExposureMask | StructureNotifyMask, &event);
 	} while (event.type != eventType);
 
 	m_visible = visible;