Browse Source

KonvergoWindow: make sure newly loaded web-client has correct initial-scale

Do this by recomputing the correct web scale before the URL change event
is emitted.

This probably fixes some cases of web-client not resizing properly when
changing web mode _and_ fullscreen mode.

It doesn't always work, so the merit is unknown.

Also, the other updateWindowState() and notifyScale() calls are not
needed.
Vincent Lang 7 years ago
parent
commit
517b4ee9c2
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/ui/KonvergoWindow.cpp

+ 3 - 3
src/ui/KonvergoWindow.cpp

@@ -365,8 +365,6 @@ void KonvergoWindow::updateMainSectionSettings(const QVariantMap& values)
       m_webDesktopMode = newDesktopMode;
       emit webDesktopModeChanged();
       emit webUrlChanged();
-      updateWindowState();
-      notifyScale(size());
     }
     else
     {
@@ -382,13 +380,15 @@ void KonvergoWindow::updateMainSectionSettings(const QVariantMap& values)
       SettingsComponent::Get().setValue(SETTINGS_SECTION_MAIN, "fullscreen", fullscreen);
       QTimer::singleShot(0, [=]
       {
+        auto s = size();
+        QLOG_DEBUG() << "compute scale for mode switch" << s;
+        notifyScale(s);
         m_webDesktopMode = newDesktopMode;
         emit webDesktopModeChanged();
         emit webUrlChanged();
 
         SystemComponent::Get().setCursorVisibility(true);
         updateWindowState();
-        notifyScale(size());
       });
     }
   }