فهرست منبع

KonvergoWindow: dump the current Qt screen list too

Also remove the similar logging from DisplayComponent.cpp (what we do is
more complete, and also dumps info relevant for some KonvergoWindow
internal mechanisms, so it's better to have this code in
KonvergoWindow.cpp).
Vincent Lang 8 سال پیش
والد
کامیت
3205291709
2فایلهای تغییر یافته به همراه9 افزوده شده و 3 حذف شده
  1. 0 1
      src/display/DisplayComponent.cpp
  2. 9 2
      src/ui/KonvergoWindow.cpp

+ 0 - 1
src/display/DisplayComponent.cpp

@@ -72,7 +72,6 @@ bool DisplayComponent::componentInitialize()
 
     for(QScreen *screen : app->screens())
     {
-      QLOG_INFO() << "Screen" << screen << "with geometry" << screen->virtualGeometry();
       connect(screen, SIGNAL(refreshRateChanged(qreal)), this, SLOT(monitorChange()));
       connect(screen, SIGNAL(geometryChanged(QRect)), this, SLOT(monitorChange()));
     }

+ 9 - 2
src/ui/KonvergoWindow.cpp

@@ -725,21 +725,28 @@ void KonvergoWindow::updateScreens()
   settingList << defentry;
 
   bool currentPresent = false;
+  int num = 0;
   for(QScreen* screen : qApp->screens())
   {
     QRect rc = screen->geometry();
+    bool active = screen == windowScreen;
 
     QVariantMap entry;
     entry["value"] = screen->name();
     entry["title"] =
       QString("%1,%2 %3x%4").arg(rc.left()).arg(rc.top()).arg(rc.right()).arg(rc.bottom()) +
       " (" + screen->name() + ")" +
-      ((screen == windowScreen) ? " *" : "");
+      (active ? " *" : "");
 
     settingList << entry;
 
-    if (screen->name() == screenName)
+    bool selected = screen->name() == screenName;
+    if (selected)
       currentPresent = true;
+
+    QLOG_DEBUG() << "Screen" << (num++) << screen << screen->geometry()
+                 << screen->virtualGeometry() << "active:" << active
+                 << "selected:" << selected;
   }
 
   if (!currentPresent && !screenName.isEmpty())