Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
5.9.3
-
None
-
ee19e15ef7d4c7caeeec56b0a75ddf90c4650119
Description
Sample code:
#include <QGuiApplication> #include <QScreen> #include <QDebug> int main(int argc, char *argv[]) { QGuiApplication a(argc, argv); qDebug() << "Number of screens:" << QGuiApplication::screens().size(); qDebug() << "Primary screen:" << QGuiApplication::primaryScreen()->name(); foreach (QScreen *screen, QGuiApplication::screens()) { auto name = screen->name(); qDebug() << "Monitoring screen: " << name; screen->setOrientationUpdateMask(Qt::LandscapeOrientation | Qt::PortraitOrientation | Qt::InvertedLandscapeOrientation | Qt::InvertedPortraitOrientation); QObject::connect(screen, &QScreen::orientationChanged, [=] (const Qt::ScreenOrientation &newScreenRotation) { qDebug() << "Orientation changed for screen" << name << ":" << newScreenRotation; }); } return a.exec(); }
Build, run, and then rotate each screen e.g. with
$ xrandr --output DVI-D-0 --rotate inverted
Events are fired only for one of the screens (usually primary?)
Seems to be caused by relying on RRScreenChangeNotify (xcb_randr_screen_change_notify_event_t) in qxcbscreen to monitor rotation changes, which is not mutliscreen-friendly: https://bugs.freedesktop.org/show_bug.cgi?id=104495