Explorar el Código

KonvergoWindow: fix toggling fullscreen with external WM commands

At least on Linux, a WM can change the fullscreen state of a Window.
This didn't resize the window correctly, because loadGeometry() uses the
fullscreen setting, which was updated after calling loadGeometry(). Fix
this by swapping the code blocks around and updating the fullscreen
setting before calling loadGeometry().
Vincent Lang hace 8 años
padre
commit
2299576aee
Se han modificado 1 ficheros con 9 adiciones y 9 borrados
  1. 9 9
      src/ui/KonvergoWindow.cpp

+ 9 - 9
src/ui/KonvergoWindow.cpp

@@ -389,6 +389,15 @@ void KonvergoWindow::onVisibilityChanged(QWindow::Visibility visibility)
 {
   QLOG_DEBUG() << (visibility == QWindow::FullScreen ? "FullScreen" : "Windowed") << "visbility set to " << visibility;
 
+  if (visibility == QWindow::FullScreen || visibility == QWindow::Windowed)
+  {
+    m_ignoreFullscreenSettingsChange++;
+    ScopedDecrementer decrement(&m_ignoreFullscreenSettingsChange);
+
+    bool fs = visibility == QWindow::FullScreen;
+    SettingsComponent::Get().setValue(SETTINGS_SECTION_MAIN, "fullscreen", fs);
+  }
+
   if (visibility == QWindow::Windowed)
   {
     loadGeometry();
@@ -405,15 +414,6 @@ void KonvergoWindow::onVisibilityChanged(QWindow::Visibility visibility)
 #endif
   }
 
-  if (visibility == QWindow::FullScreen || visibility == QWindow::Windowed)
-  {
-    m_ignoreFullscreenSettingsChange++;
-    ScopedDecrementer decrement(&m_ignoreFullscreenSettingsChange);
-
-    bool fs = visibility == QWindow::FullScreen;
-    SettingsComponent::Get().setValue(SETTINGS_SECTION_MAIN, "fullscreen", fs);
-  }
-
   if (visibility == QWindow::Minimized)
     InputComponent::Get().cancelAutoRepeat();