Browse Source

KonvergoWindow: add a hidden forceAlwaysFS setting

If set to true, it aggressively tries to enter or re-enter fullscreen
mode. It's probably too aggressive and obscure as that I'd want it to be
visible by default.

This will probably help with Windows fullscreen&hotplugging problems,
although since they are so hard to reproduce, I didn't get to test it.
Vincent Lang 8 years ago
parent
commit
bc30730a24
2 changed files with 14 additions and 1 deletions
  1. 5 0
      resources/settings/settings_description.json
  2. 9 1
      src/ui/KonvergoWindow.cpp

+ 5 - 0
resources/settings/settings_description.json

@@ -146,6 +146,11 @@
         "value": "forceFSScreen",
         "platforms_excluded": [ "oe" ],
         "default": ""
+      },
+      {
+        "value": "forceAlwaysFS",
+        "default": false,
+        "hidden": true
       }
     ]
   },

+ 9 - 1
src/ui/KonvergoWindow.cpp

@@ -422,7 +422,7 @@ void KonvergoWindow::updateForcedScreen()
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 void KonvergoWindow::updateWindowState(bool saveGeo)
 {
-  if (SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "fullscreen").toBool() || SystemComponent::Get().isOpenELEC())
+  if (SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "fullscreen").toBool() || SystemComponent::Get().isOpenELEC() || SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "forceAlwaysFS").toBool())
   {
     // if we were go from windowed to fullscreen
     // we want to store our current windowed position
@@ -509,6 +509,14 @@ void KonvergoWindow::onVisibilityChanged(QWindow::Visibility visibility)
   }
 #endif
 
+  if (visibility == QWindow::Windowed && SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "forceAlwaysFS").toBool())
+  {
+    QLOG_WARN() << "Forcing re-entering fullscreen because of forceAlwaysFS setting!";
+    updateForcedScreen(); // if a specific screen is forced, try to move the window there
+    setVisibility(QWindow::FullScreen);
+    return;
+  }
+
   if (visibility == QWindow::FullScreen || visibility == QWindow::Windowed)
   {
     m_ignoreFullscreenSettingsChange++;