Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.3.0 Beta1
-
None
Description
I've been trying to get my application to react properly to screen changes, then I realized that it was not possible, because QGuiApplication::primaryScreen doesn't react to X11 primary screen changes and uses a random screen after a screen is added or removed.
I made a small test so that it can be confirmed properly. The test writes down the primary screen and the list of screens to stdout twice every second. I'm using the following commands to change the number of screens:
1. xrandr --output HDMI1 --off --output LVDS1 --primary # to turn off one of the screens and make the other primary
2. xrandr --output HDMI1 --primary --auto --right-of LVDS1 # to turn the screen on and make it primary.
Now the output I'm getting is the following:
- I start with 2 screens, HDMI is primary (2)
primary: HDMI1 screens: HDMI1 LVDS1
primary: HDMI1 screens: HDMI1 LVDS1
primary: HDMI1 screens: HDMI1 LVDS1
... - Here I turn one off (1)
primary: LVDS1 screens: LVDS1
primary: LVDS1 screens: LVDS1
primary: LVDS1 screens: LVDS1
... - Here I turn the second screen back on and make it primary (2)
primary: LVDS1 screens: LVDS1 HDMI1
primary: LVDS1 screens: LVDS1 HDMI1
primary: LVDS1 screens: LVDS1 HDMI1
As you can see, it decides somehow to report LVDS1 as the primary screen even though we asked the graphics system to make the other one primary by default. I would expect the behavior to be consistent.
Attachments
Issue Links
- relates to
-
QTBUG-44213 QScreen availableGeometry is incorrect after unplugging then plugging in primary monitor on Windows 7
- Closed
-
QTBUG-33048 QDesktopWidget::primaryScreen() is always 0 and QGuiApplication::screens() always returns the primary one as first
- Closed
-
QTBUG-40659 QDesktopWidget::primaryScreen() always return the old value.
- Closed