Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15.11, 5.15.10
-
None
-
Qt 5.15.11
Windows 11 22H2
Description
QWindow::screen()->geometry() does not update for second screen rearrangement.
Steps to reproduce:
- create analogclock sample project
- add
bool AnalogClockWindow::nativeEvent(const QByteArray &eventType, void *message, long *result){ MSG *msg = static_cast<MSG *>(message); switch (msg->message) { case WM_SIZE: { QScreen* screen = this->screen(); QRect screenGeo = screen->geometry(); QRect curGeo = this->geometry(); bool curInScreen = screenGeo.contains(curGeo); qDebug()<<"curInScreen"<<curInScreen; break; } } return RasterWindow::nativeEvent(eventType, message, result); }
- run program
- open System Settings > System > Display
- move second display to another side > apply
- move second display back > apply
- move program to second display
- when resize program, curInScreen become false because screen->geometry() stays at the value of first rearrangement