I need to programatically obtain screen rotation. I'm using Qt and the X extension XRandr. I'm trying the following:
Display *dpy; Window root; XRRScreenConfiguration *conf; Rotation rotation; int screen; dpy = QX11Info::display(); root = QX11Info::appRootWindow(); conf = XRRGetScreenInfo(dpy, root); screen = DefaultScreen(dpy); XRRRotations(dpy, screen, &rotation); qDebug() << "CURRENT ROTATION:" << rotation;
The problem is that independently of the current screen orientation, set through Displays settings app from Ubuntu, the CURRENT ROTATION output is always 1.
Does anyone knows why?