x11: Keep the window from stealing input.
authorEric Anholt <eanholt@broadcom.com>
Thu, 12 Apr 2018 21:59:32 +0000 (14:59 -0700)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 9 Aug 2018 14:01:33 +0000 (10:01 -0400)
When debugging on an X11 desktop and doing repeated runs, it's
unpleasant to have input focus stolen by a series of transient windows
being created.

Components: Framework
Affects: *
VK-GL-CTS issue: 1282
Change-Id: I7bc8e9587e71ac9ebfab726c3926c432b2f04f01

framework/platform/lnx/X11/tcuLnxX11.cpp

index 1a60860..1dd2a3d 100644 (file)
@@ -184,6 +184,15 @@ XlibWindow::XlibWindow (XlibDisplay& display, int width, int height, ::Visual* v
                                                         depth, InputOutput, visual, mask, &swa);
        TCU_CHECK(m_window);
 
+       /* Prevent the window from stealing input, since our windows are
+        * non-interactive.
+        */
+       XWMHints *hints = XAllocWMHints();
+       hints->flags |= InputHint;
+       hints->input = False;
+       XSetWMHints(dpy, m_window, hints);
+       XFree(hints);
+
        Atom deleteAtom = m_display.getDeleteAtom();
        XSetWMProtocols(dpy, m_window, &deleteAtom, 1);
        XSync(dpy,false);