From b55fac3f3763ffae3bf99f2afea7e5d5f8b7c2a8 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Fri, 5 Jul 2019 14:15:29 +0200 Subject: xcb: reduce focus-in delay This patch amends fe63900dc9891dd355ca1f10d6c7e5fd1516f5d5 The previous value of 400ms was a random and seemingly harmless choice. It turns out that 400ms is a bit too long and interferes with x11 async behavior tweaks in the VirtualBox source code. The original aim of specifying a concrete delay was to fix the nondeterministic behavior of the pre-existing code and to avoid flickering on KWin caused by waiting too little. This patch changes 400ms -> 100ms, which seems to work better in practice. Fixes: QTBUG-76742 Change-Id: Ia8168216819ac41d0124622c9472a98a1877262f Reviewed-by: Shawn Rutledge --- src/plugins/platforms/xcb/qxcbconnection.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/plugins/platforms/xcb/qxcbconnection.cpp') diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index 06d1000993..f98b2dfe3a 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -132,7 +132,9 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra if (!m_startupId.isNull()) qunsetenv("DESKTOP_STARTUP_ID"); + const int focusInDelay = 100; m_focusInTimer.setSingleShot(true); + m_focusInTimer.setInterval(focusInDelay); m_focusInTimer.callOnTimeout([]() { // No FocusIn events for us, proceed with FocusOut normally. QWindowSystemInterface::handleWindowActivated(nullptr, Qt::ActiveWindowFocusReason); -- cgit v1.2.3