Ver Fonte

Add more logging to getApplicationDisplay() code

We're still trying to figure out why this fails sometimes on Windows.
Vincent Lang há 9 anos atrás
pai
commit
6e52c2a0fb

+ 8 - 0
src/display/DisplayComponent.cpp

@@ -227,11 +227,19 @@ int DisplayComponent::getApplicationDisplay()
 
   int display = -1;
   if (activeWindow && m_displayManager)
+  {
+    QLOG_DEBUG() << "Looking for a display at:" << activeWindow->geometry()
+                 << "(center:" << activeWindow->geometry().center() << ")";
     display = m_displayManager->getDisplayFromPoint(activeWindow->geometry().center());
+  }
 
   if (display < 0)
   {
     QLOG_WARN() << "Unable to locate current display.";
   }
+  else
+  {
+    QLOG_DEBUG() << "Display found:" << display;
+  }
   return display;
 }

+ 2 - 0
src/display/win/DisplayManagerWin.cpp

@@ -160,6 +160,8 @@ int DisplayManagerWin::getDisplayFromPoint(int x, int y)
       {
         QRect displayRect(modeInfo.dmPosition.x, modeInfo.dmPosition.y, modeInfo.dmPelsWidth,
                           modeInfo.dmPelsHeight);
+        QLOG_DEBUG() << "Looking at display" << displayId << "mode" << currentMode
+                     << "at" << displayRect;
 
         if (displayRect.contains(x, y))
           return displayId;