Browse Source

KonvergoWindow: workaround for recursive web-client fullscren changes

Vincent Lang 8 years ago
parent
commit
be5aaecfba
2 changed files with 16 additions and 2 deletions
  1. 14 2
      src/ui/KonvergoWindow.cpp
  2. 2 0
      src/ui/KonvergoWindow.h

+ 14 - 2
src/ui/KonvergoWindow.cpp

@@ -37,6 +37,9 @@ KonvergoWindow::KonvergoWindow(QWindow* parent) :
   m_infoTimer->setInterval(1000);
   m_webDesktopMode = (SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "webMode").toString() == "desktop");
 
+  m_resizeHack = new QTimer(this);
+  m_resizeHack->setSingleShot(true);
+
   installEventFilter(new EventFilter(this));
 
   connect(m_infoTimer, &QTimer::timeout, this, &KonvergoWindow::updateDebugInfo);
@@ -306,8 +309,15 @@ void KonvergoWindow::updateMainSectionSettings(const QVariantMap& values)
 
   if (values.contains("fullscreen") && !m_ignoreFullscreenSettingsChange)
   {
-    InputComponent::Get().cancelAutoRepeat();
-    updateWindowState();
+    if (m_resizeHack->isActive())
+    {
+      QLOG_ERROR() << "Warning! Ignoring recursive fullscreen change request.";
+    }
+    else
+    {
+      InputComponent::Get().cancelAutoRepeat();
+      updateWindowState();
+    }
   }
 
   if (values.contains("webMode"))
@@ -346,6 +356,8 @@ void KonvergoWindow::updateMainSectionSettings(const QVariantMap& values)
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 void KonvergoWindow::updateWindowState(bool saveGeo)
 {
+  m_resizeHack->start(1000);
+
   if (SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "fullscreen").toBool() || SystemComponent::Get().isOpenELEC())
   {
     // if we were go from windowed to fullscreen

+ 2 - 0
src/ui/KonvergoWindow.h

@@ -160,6 +160,8 @@ private:
 
   unsigned long m_osxPresentationOptions;
 
+  QTimer* m_resizeHack;
+
   void setWebMode(bool newDesktopMode, bool fullscreen);
 };