Revert "Windows QPA: Change monitor index detection"
This reverts commit f4d6d04898bcc239f4b271330ba778de69bbd893. Reason for revert: EDID serial numbers can be shared across monitors, so the move to EDID serial number for screen index detection does not work as intended,and breaks monitor detection. Fixes: QTBUG-116499 Change-Id: I6995b21788eb632e38eeef3a93492dbe0740da4a Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 695948fad028f97521135ecb3478f2798ae6700f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
d05102e1da
commit
bd4ab9c23c
@ -695,19 +695,19 @@ bool QWindowsScreenManager::isSingleScreen()
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline int indexOfMonitor(const QWindowsScreenManager::WindowsScreenList &screens,
|
static inline int indexOfMonitor(const QWindowsScreenManager::WindowsScreenList &screens,
|
||||||
const QString &serialNumberIn)
|
const QString &deviceName)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < screens.size(); ++i)
|
for (int i= 0; i < screens.size(); ++i)
|
||||||
if (screens.at(i)->data().serialNumber == serialNumberIn)
|
if (screens.at(i)->data().deviceName == deviceName)
|
||||||
return i;
|
return i;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int indexOfMonitor(const WindowsScreenDataList &screenData,
|
static inline int indexOfMonitor(const WindowsScreenDataList &screenData,
|
||||||
const QString &serialNumberIn)
|
const QString &deviceName)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < screenData.size(); ++i)
|
for (int i = 0; i < screenData.size(); ++i)
|
||||||
if (screenData.at(i).serialNumber == serialNumberIn)
|
if (screenData.at(i).deviceName == deviceName)
|
||||||
return i;
|
return i;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -773,7 +773,7 @@ bool QWindowsScreenManager::handleScreenChanges()
|
|||||||
const bool lockScreen = newDataList.size() == 1 && (newDataList.front().flags & QWindowsScreenData::LockScreen);
|
const bool lockScreen = newDataList.size() == 1 && (newDataList.front().flags & QWindowsScreenData::LockScreen);
|
||||||
bool primaryScreenChanged = false;
|
bool primaryScreenChanged = false;
|
||||||
for (const QWindowsScreenData &newData : newDataList) {
|
for (const QWindowsScreenData &newData : newDataList) {
|
||||||
const int existingIndex = indexOfMonitor(m_screens, newData.serialNumber);
|
const int existingIndex = indexOfMonitor(m_screens, newData.deviceName);
|
||||||
if (existingIndex != -1) {
|
if (existingIndex != -1) {
|
||||||
m_screens.at(existingIndex)->handleChanges(newData);
|
m_screens.at(existingIndex)->handleChanges(newData);
|
||||||
if (existingIndex == 0)
|
if (existingIndex == 0)
|
||||||
@ -790,7 +790,7 @@ bool QWindowsScreenManager::handleScreenChanges()
|
|||||||
// temporary lock screen to avoid window recreation (QTBUG-33062).
|
// temporary lock screen to avoid window recreation (QTBUG-33062).
|
||||||
if (!lockScreen) {
|
if (!lockScreen) {
|
||||||
for (int i = m_screens.size() - 1; i >= 0; --i) {
|
for (int i = m_screens.size() - 1; i >= 0; --i) {
|
||||||
if (indexOfMonitor(newDataList, m_screens.at(i)->data().serialNumber) == -1)
|
if (indexOfMonitor(newDataList, m_screens.at(i)->data().deviceName) == -1)
|
||||||
removeScreen(i);
|
removeScreen(i);
|
||||||
} // for existing screens
|
} // for existing screens
|
||||||
} // not lock screen
|
} // not lock screen
|
||||||
|
Loading…
x
Reference in New Issue
Block a user