Kaynağa Gözat

KonvergoWindow: don't save geo when non-windowed, more debugging output

Don't save the window geometry if we aren't windowed. I'm hoping that
this helps us avoiding getting and saving out of bounds values. This
should be pretty save in other scenarios.

Still trying to find out what happens in #495, the debug messages might
also help with this.
Vincent Lang 8 yıl önce
ebeveyn
işleme
617d7e33ae
1 değiştirilmiş dosya ile 8 ekleme ve 0 silme
  1. 8 0
      src/ui/KonvergoWindow.cpp

+ 8 - 0
src/ui/KonvergoWindow.cpp

@@ -169,6 +169,12 @@ bool KonvergoWindow::fitsInScreens(const QRect& rc)
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 void KonvergoWindow::saveGeometry()
 {
+  QLOG_DEBUG() << "Window state when saving geometry:" << visibility();
+  if (visibility() != QWindow::Windowed)
+  {
+    QLOG_DEBUG() << "Not saving geometry.";
+  }
+
   QRect rc = geometry();
 
   // lets make sure we are not saving something craycray
@@ -178,6 +184,8 @@ void KonvergoWindow::saveGeometry()
   if (!fitsInScreens(rc))
     return;
 
+  QLOG_DEBUG() << "Saving window geometry:" << rc;
+
   QVariantMap map = {{"x", rc.x()}, {"y", rc.y()},
                      {"width", rc.width()}, {"height", rc.height()}};
   SettingsComponent::Get().setValue(SETTINGS_SECTION_STATE, "geometry", map);