From d8667fde189fa08002295fc66414d67e73b3c67b Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Fri, 8 Apr 2016 18:50:15 +0300 Subject: xcb: Fix interpretation of the size from RRCrtcChangeNotify MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The size in RRCrtcChangeNotify is a size of the mode and it is not rotated. At the same time when we call RRGetCrtcInfo, it returns a rotated size, which is then passed to QXcbScreen::updateGeometry(const QRect &geom, uint8_t rotation). So to pass the expected size to QXcbScreen::updateGeometry() after receiving RRCrtcChangeNotify, we should rotate the size according the screen rotation. Change-Id: If5b5b52403b077d3cd64b9a05d938bb9ac00b1e0 Reviewed-by: Daniel Vrátil Reviewed-by: Laszlo Agocs --- src/plugins/platforms/xcb/qxcbconnection.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/plugins') diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index 05c02249cc..135c763dc1 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -209,6 +209,9 @@ void QXcbConnection::updateScreens(const xcb_randr_notify_event_t *event) // CRTC with node mode could mean that output has been disabled, and we'll // get RRNotifyOutputChange notification for that. if (screen && crtc.mode) { + if (crtc.rotation == XCB_RANDR_ROTATION_ROTATE_90 || + crtc.rotation == XCB_RANDR_ROTATION_ROTATE_270) + std::swap(crtc.width, crtc.height); screen->updateGeometry(QRect(crtc.x, crtc.y, crtc.width, crtc.height), crtc.rotation); if (screen->mode() != crtc.mode) screen->updateRefreshRate(crtc.mode); -- cgit v1.2.3