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

Primary orientation isn't updated after rotating screen

    XMLWordPrintable

Details

    • Linux/X11

    Description

       

      //demo
      
      #include <QApplication>
      #include <QDebug>
      #include <QTimer>
      #include <QScreen>
      
      int main(int argc,char* argv[])
      {
          if (!qgetenv("QT_SCREEN_SCALE_FACTORS").isEmpty()) {
              qDebug() << qgetenv("QT_SCREEN_SCALE_FACTORS");
              qunsetenv("QT_SCREEN_SCALE_FACTORS");
          }
          QApplication a(argc,argv);
          QTimer t;
          t.connect(&t,&QTimer::timeout,[](){
              auto screen = qApp->primaryScreen();
              auto orientation = screen->primaryOrientation();
              qDebug() << "primaryOrientation" << orientation;
          });
          t.start(500);
          return a.exec();
      }
      

      Run this code,and use "xrandr -o left" to rotate screen.

      the output is always "LandscapeOrientation", and the expected results should be changed to "PortraitOrientation".

       

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            zhangyu yu zhang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes