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

QGUIApplication::screens() has unstable order

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Out of scope
    • Icon: P2: Important P2: Important
    • None
    • 6.7.2
    • QPA: Wayland
    • Qt Version: qt6-base 6.7.2-1
      OS: Arch Linux, 6.10.5-arch1-1
      Hardware: two screens at 60Hz, 1920x1080 each
    • Linux/Wayland

      The list of screens returned when calling QGUIApplication::screens() changes its order, roughly every 5 reboots in my case.

      On my desktop with 2 screens connected, I rebooted several times and start an application containing the following codesnippet once every time:

      QString filename = QLatin1String("<some filename>");
      QFile file(filename);
      if (file.open(QIODevice::ReadWrite | QIODevice::Append)) {
          QTextStream stream(&file);
          for (auto it : QGuiApplication::screens())
              stream << "Data: " << qPrintable(it->name()) << qPrintable(it->model()) << "\n";
      }

       

      No other changes to settings or hardware were made between reboots. The produced text file has one entry for each screen for every line for every reboot, and their order switches every couple reboots.

      This is also causing bugs downstream, e.g. at KDE, where this bug has been reported 7 years ago already.

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

            qt.team.graphics.and.multimedia Qt Graphics Team
            nightoo No Way
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes