Browse Source

KonvergoWindow: always cancel autorepeat when changing window states

Slight improvement on OSX. Going fullscreen via settings could make it
keep repeating the last pressed key.
Vincent Lang 7 years ago
parent
commit
72ee8b8689
1 changed files with 4 additions and 6 deletions
  1. 4 6
      src/ui/KonvergoWindow.cpp

+ 4 - 6
src/ui/KonvergoWindow.cpp

@@ -339,10 +339,7 @@ void KonvergoWindow::updateMainSectionSettings(const QVariantMap& values)
     updateWindowState();
 
   if (values.contains("fullscreen") && !m_ignoreFullscreenSettingsChange)
-  {
-    InputComponent::Get().cancelAutoRepeat();
     updateWindowState();
-  }
 
   if (values.contains("webMode"))
   {
@@ -403,6 +400,7 @@ void KonvergoWindow::updateForcedScreen()
       setScreen(scr);
       setGeometry(scr->geometry());
       setVisibility(QWindow::FullScreen);
+      InputComponent::Get().cancelAutoRepeat();
       return;
     }
   }
@@ -442,6 +440,8 @@ void KonvergoWindow::updateWindowState(bool saveGeo)
     else
       setFlags(flags() &~ forceOnTopFlags);
   }
+
+  InputComponent::Get().cancelAutoRepeat();
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -520,9 +520,7 @@ void KonvergoWindow::onVisibilityChanged(QWindow::Visibility visibility)
   }
 #endif
 
-  if (visibility == QWindow::Minimized)
-    InputComponent::Get().cancelAutoRepeat();
-
+  InputComponent::Get().cancelAutoRepeat();
   notifyScale(size());
 }