فهرست منبع

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 8 سال پیش
والد
کامیت
2299576aee
1فایلهای تغییر یافته به همراه9 افزوده شده و 9 حذف شده
  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();