-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.2.4
-
None
-
Windows 10
-
-
f4d6d0489 (dev), b7053fc2b (6.5), e14fe5f84 (6.6)
I have 2 identical monitors connected to a Window 10 PC.
Both monitors show the same name in the windows display settings (Q2790).

QGuiApplication::screens() only returns one (the secondary monitor) causing a lot of weird problems.
- Main Window Menu Pops up on the secondary, while the main window is on the primary screen
- Message boxes popping up on the secondary screen
- New Windows placed on the secondary screen
The problem seems to be caused by a problem within QWindowsScreenManager::handleScreenChanges()
bool QWindowsScreenManager::handleScreenChanges()
{
// Here both Monitors are in the list
const WindowsScreenDataList newDataList = monitorData();
const bool lockScreen = newDataList.size() == 1 && (newDataList.front().flags & QWindowsScreenData::LockScreen);
bool primaryScreenChanged = false;
for (const QWindowsScreenData &newData : newDataList) {
// due to both monitors have the same name, the primary screen gets
// overwritten by the secondary monitor
const int existingIndex = indexOfMonitor(m_screens, newData.name);
if (existingIndex != -1) {
m_screens.at(existingIndex)->handleChanges(newData);
if (existingIndex == 0)
primaryScreenChanged = true;
} else {
The problem is not present on Qt 5.12.12.
I will try to rename one of the monitors to workaround the problem.