Kaynağa Gözat

Try to fix the presentationOptions

Tobias Hieta 8 yıl önce
ebeveyn
işleme
749731d39c
1 değiştirilmiş dosya ile 15 ekleme ve 11 silme
  1. 15 11
      src/ui/KonvergoWindow.cpp

+ 15 - 11
src/ui/KonvergoWindow.cpp

@@ -352,12 +352,6 @@ void KonvergoWindow::updateWindowState(bool saveGeo)
       saveGeometry();
 
     setVisibility(QWindow::FullScreen);
-
-#ifdef Q_OS_MAC
-    QTimer::singleShot(0, [&] {
-      OSXUtils::SetPresentationOptions(m_osxPresentationOptions | OSXUtils::GetPresentationOptionsForFullscreen(!m_webDesktopMode));
-    });
-#endif
   }
   else
   {
@@ -373,10 +367,6 @@ void KonvergoWindow::updateWindowState(bool saveGeo)
       setFlags(flags() | forceOnTopFlags);
     else
       setFlags(flags() &~ forceOnTopFlags);
-
-#ifdef Q_OS_MAC
-    QTimer::singleShot(0, [&]{ OSXUtils::SetPresentationOptions(m_osxPresentationOptions); });
-#endif
   }
 }
 
@@ -398,9 +388,23 @@ void KonvergoWindow::onVisibilityChanged(QWindow::Visibility visibility)
   QLOG_DEBUG() << (visibility == QWindow::FullScreen ? "FullScreen" : "Windowed") << "visbility set to " << visibility;
 
   if (visibility == QWindow::Windowed)
+  {
     loadGeometry();
+#ifdef Q_OS_MAC
+    QTimer::singleShot(0, [&] { OSXUtils::SetPresentationOptions(m_osxPresentationOptions); });
+#endif
+  }
+  else if (visibility == QWindow::FullScreen)
+  {
+#ifdef Q_OS_MAC
+    QTimer::singleShot(0, [&] {
+      OSXUtils::SetPresentationOptions(m_osxPresentationOptions | OSXUtils::GetPresentationOptionsForFullscreen(!m_webDesktopMode));
+    });
+#endif
+  }
 
-  if (visibility == QWindow::FullScreen || visibility == QWindow::Windowed) {
+  if (visibility == QWindow::FullScreen || visibility == QWindow::Windowed)
+  {
     m_ignoreFullscreenSettingsChange++;
     ScopedDecrementer decrement(&m_ignoreFullscreenSettingsChange);