From e6f1e5fdc7043b86408ab08fd13bdfbd5cfe59d0 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Mon, 5 Oct 2015 12:08:55 -0500 Subject: [PATCH] xcb: Ignore disabling of outputs in the middle of the mode switch --- ...ling-of-outputs-in-the-middle-of-the.patch | 56 +++++++++++++++++++ qt5-qtbase.spec | 4 ++ 2 files changed, 60 insertions(+) create mode 100644 0197-xcb-Ignore-disabling-of-outputs-in-the-middle-of-the.patch diff --git a/0197-xcb-Ignore-disabling-of-outputs-in-the-middle-of-the.patch b/0197-xcb-Ignore-disabling-of-outputs-in-the-middle-of-the.patch new file mode 100644 index 0000000..364426e --- /dev/null +++ b/0197-xcb-Ignore-disabling-of-outputs-in-the-middle-of-the.patch @@ -0,0 +1,56 @@ +From ae51e360f986698eaf41fdb38f8a878a50f69be1 Mon Sep 17 00:00:00 2001 +From: Alexander Volkov +Date: Fri, 19 Jun 2015 13:34:11 +0300 +Subject: [PATCH 197/412] xcb: Ignore disabling of outputs in the middle of the + mode switch +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +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 +Reviewed-by: Gatis Paeglis +Reviewed-by: Shawn Rutledge +--- + src/plugins/platforms/xcb/qxcbconnection.cpp | 18 +++++++++++++----- + 1 file changed, 13 insertions(+), 5 deletions(-) + +diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp +index 0867615..29e1fd1 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 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); +-- +2.5.0 + diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 7e35919..d3bbbd2 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -116,6 +116,8 @@ Patch101: qt5-qtbase-QTBUG-47041.patch #SM_CLIENT_ID property is not set Patch223: 0123-xcb-set-SM_CLIENT_ID-property.patch +Patch297: 0197-xcb-Ignore-disabling-of-outputs-in-the-middle-of-the.patch + # https://bugs.kde.org/show_bug.cgi?id=344469 Patch155: 0055-Respect-manual-set-icon-themes.patch @@ -392,6 +394,7 @@ rm -fv mkspecs/linux-g++*/qmake.conf.multilib-optflags %patch101 -p1 -b .QTBUG-47041 %patch155 -p1 -b .0055 %patch223 -p1 -b .QTBUG-46310 +%patch297 -p1 -b .0197 # drop -fexceptions from $RPM_OPT_FLAGS RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's|-fexceptions||g'` @@ -950,6 +953,7 @@ fi %changelog * Mon Oct 05 2015 Rex Dieter 5.5.0-18 - When a screen comes back online, the windows need to be told about it (QTBUG-47041) +- xcb: Ignore disabling of outputs in the middle of the mode switch * Wed Aug 19 2015 Rex Dieter 5.5.0-17 - unconditionally undo valgrind hack when done (#1255054)