summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb
diff options
context:
space:
mode:
authorAlexander Volkov <a.volkov@rusbitech.ru>2015-06-19 13:34:11 +0300
committerShawn Rutledge <shawn.rutledge@theqtcompany.com>2015-07-22 12:35:16 +0000
commitae51e360f986698eaf41fdb38f8a878a50f69be1 (patch)
tree83567b2ce47af8ad03c7ceba903605df67ecf545 /src/plugins/platforms/xcb
parentb0b08cc0e4e38504d6b833702f7477aee4e2a192 (diff)
xcb: Ignore disabling of outputs in the middle of the mode switch
X server may send RROutputChangeNotify event with null crtc and mode, when it switches an output mode. Request RROutputInfo to distinguish this case from the case when the output is explicitly disabled. Change-Id: I4c2356ec71dbcc8013009ea8a6f46dd11f19d6bb Task-number: QTBUG-44158 Task-number: QTBUG-46786 Task-number: QTBUG-46822 Reviewed-by: Daniel Vrátil <dvratil@redhat.com> Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index 08676152dc..29e1fd145d 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -265,11 +265,19 @@ void QXcbConnection::updateScreens(const xcb_randr_notify_event_t *event)
} else if (screen) {
// Screen has been disabled -> remove
if (output.crtc == XCB_NONE && output.mode == XCB_NONE) {
- qCDebug(lcQpaScreen) << "output" << screen->name() << "has been disabled";
- m_screens.removeOne(screen);
- foreach (QXcbScreen *otherScreen, m_screens)
- otherScreen->removeVirtualSibling((QPlatformScreen *) screen);
- QXcbIntegration::instance()->destroyScreen(screen);
+ xcb_randr_get_output_info_cookie_t outputInfoCookie =
+ xcb_randr_get_output_info(xcb_connection(), output.output, output.config_timestamp);
+ QScopedPointer<xcb_randr_get_output_info_reply_t, QScopedPointerPodDeleter> outputInfo(
+ xcb_randr_get_output_info_reply(xcb_connection(), outputInfoCookie, NULL));
+ if (outputInfo->crtc == XCB_NONE) {
+ qCDebug(lcQpaScreen) << "output" << screen->name() << "has been disabled";
+ m_screens.removeOne(screen);
+ foreach (QXcbScreen *otherScreen, m_screens)
+ otherScreen->removeVirtualSibling((QPlatformScreen *) screen);
+ QXcbIntegration::instance()->destroyScreen(screen);
+ } else {
+ qCDebug(lcQpaScreen) << "output" << screen->name() << "has been temporarily disabled for the mode switch";
+ }
} else {
// Just update existing screen
screen->updateGeometry(output.config_timestamp);