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

QGuiApplication::primaryScreenChanged() signal not working under X11

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • 5.12, 5.15, 6.2
    • QPA: X11/XCB
    • None
    • Linux/X11

    Description

      The primaryScreenChanged signal is not fired when changing primary display with xrandr in Linux.

        xrandr --output DP2-1 --off
        xrandr --output eDP1 --primary --mode 1366x768 --pos 0x0 --rotate normal --dpi 96x96
        xrandr --output eDP1 --off
        xrandr --output DP2-1 --primary --mode 3440x1440 --pos 0x0 --rotate normal --dpi 102x102
      
      #!/usr/bin/python3
      from PyQt5 import QtWidgets
      
      def screenChanged(self, *args):
          print("Screen changed")
      
      app = QtWidgets.QApplication([])
      app.primaryScreenChanged.connect(screenChanged)
      core = QtWidgets.QMainWindow()
      core.show()
      app.exec()

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              liaqi Liang Qi
              william.belanger William Belanger
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes