We're still trying to figure out why this fails sometimes on Windows.
@@ -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;
@@ -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;