- Build and launch the app below on a PC with two displays
- Close the app's main window
- Disconnect a display
- Restore the app from the system tray icon (via double click)
- The screen count is "1"
- The screen count remains at "2"
- QGuiApplication::screens() is pulling from a cached screen list (QWindowsScreenManager::m_screens)
- Qt seems to be relying on the WM_DISPLAYCHANGE event to update this list. WM_DISPLAYCHANGE is sent to top level windows so the list is not updated properly if no Qt windows are open when the display is disconnected
- If you skip step 2 (closing the window), the screen count updates as expected