virtualbox-focus.patch 1.3 KB

12345678910111213141516171819202122232425262728
  1. diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
  2. index 06d1000993b..f98b2dfe3af 100644
  3. --- a/src/plugins/platforms/xcb/qxcbconnection.cpp
  4. +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
  5. @@ -132,7 +132,9 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra
  6. if (!m_startupId.isNull())
  7. qunsetenv("DESKTOP_STARTUP_ID");
  8. + const int focusInDelay = 100;
  9. m_focusInTimer.setSingleShot(true);
  10. + m_focusInTimer.setInterval(focusInDelay);
  11. m_focusInTimer.callOnTimeout([]() {
  12. // No FocusIn events for us, proceed with FocusOut normally.
  13. QWindowSystemInterface::handleWindowActivated(nullptr, Qt::ActiveWindowFocusReason);
  14. diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
  15. index 9382488b741..610eca06a55 100644
  16. --- a/src/plugins/platforms/xcb/qxcbwindow.cpp
  17. +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
  18. @@ -848,7 +848,7 @@ void QXcbWindow::doFocusOut()
  19. connection()->setFocusWindow(nullptr);
  20. relayFocusToModalWindow();
  21. // Do not set the active window to nullptr if there is a FocusIn coming.
  22. - connection()->focusInTimer().start(400);
  23. + connection()->focusInTimer().start();
  24. }
  25. struct QtMotifWmHints {