Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-38404

XCB: QGuiApplication::primaryScreen doesn't change according to the primary screen

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.6
    • 5.3.0 Beta1
    • GUI: Workspace
    • 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

          Activity

            People

              tvete Paul Olav Tvete
              apol-old Aleix Pol (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: