From 5ece80d791e82a54240aace160e16c3535de2a79 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Jul 13 2015 13:46:39 +0000 Subject: Qt5 application crashes when connecting/disconnecting displays (#1083664) --- diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 2134d06..f8ac1d6 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -38,7 +38,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.5.0 -Release: 3%{?dist} +Release: 4%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -81,6 +81,10 @@ Patch13: qtbase-opensource-src-5.5.x-big-endian.patch # NEEDS REBASE Patch50: qt5-poll.patch +# Qt5 application crashes when connecting/disconnecting displays +# https://bugzilla.redhat.com/show_bug.cgi?id=1083664 +Patch51: qtbase-opensource-src-5.5-disconnect_displays.patch + # macros, be mindful to keep sync'd with macros.qt5 Source1: macros.qt5 %define _qt5 %{name} @@ -335,6 +339,7 @@ rm -fv mkspecs/linux-g++*/qmake.conf.multilib-optflags %patch13 -p1 -b .big-endian #patch50 -p1 -b .poll +%patch51 -p1 -b .disconnect_displays # drop -fexceptions from $RPM_OPT_FLAGS RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's|-fexceptions||g'` @@ -875,6 +880,9 @@ fi %changelog +* Mon Jul 13 2015 Rex Dieter 5.5.0-4 +- Qt5 application crashes when connecting/disconnecting displays (#1083664) + * Fri Jul 10 2015 Than Ngo - 5.5.0-3 - add better fix for compile error on big endian diff --git a/qtbase-opensource-src-5.5-disconnect_displays.patch b/qtbase-opensource-src-5.5-disconnect_displays.patch new file mode 100644 index 0000000..8a751e9 --- /dev/null +++ b/qtbase-opensource-src-5.5-disconnect_displays.patch @@ -0,0 +1,41 @@ +diff -rupN qtbase-opensource-src-5.5.0/src/gui/kernel/qplatformintegration.cpp qtbase-opensource-src-5.5.0-new/src/gui/kernel/qplatformintegration.cpp +--- qtbase-opensource-src-5.5.0/src/gui/kernel/qplatformintegration.cpp 2015-06-29 22:04:53.000000000 +0200 ++++ qtbase-opensource-src-5.5.0-new/src/gui/kernel/qplatformintegration.cpp 2015-07-12 10:24:17.195000304 +0200 +@@ -456,6 +456,14 @@ void QPlatformIntegration::screenAdded(Q + } else { + QGuiApplicationPrivate::screen_list.append(screen); + } ++ ++ // All screens might have been removed before a new one is added, so ++ // iterate over the toplevel windows and set their screen to the current ++ // primary screen if the window has no screen set ++ foreach (QWindow *window, QGuiApplication::topLevelWindows()) { ++ if (window->screen() == 0) ++ window->setScreen(QGuiApplicationPrivate::screen_list.at(0)); ++ } + emit qGuiApp->screenAdded(screen); + } + +diff -rupN qtbase-opensource-src-5.5.0/src/gui/kernel/qwindow.cpp qtbase-opensource-src-5.5.0-new/src/gui/kernel/qwindow.cpp +--- qtbase-opensource-src-5.5.0/src/gui/kernel/qwindow.cpp 2015-06-29 22:04:52.000000000 +0200 ++++ qtbase-opensource-src-5.5.0-new/src/gui/kernel/qwindow.cpp 2015-07-12 11:51:18.832889497 +0200 +@@ -372,15 +372,14 @@ void QWindowPrivate::setTopLevelScreen(Q + return; + } + if (newScreen != topLevelScreen) { +- const bool shouldRecreate = recreate && windowRecreationRequired(newScreen); +- const bool shouldShow = visibilityOnDestroy && !topLevelScreen; ++ const bool shouldRecreate = recreate/* && windowRecreationRequired(newScreen)*/; + if (shouldRecreate && platformWindow) + q->destroy(); + connectToScreen(newScreen); +- if (shouldShow) +- q->setVisible(true); +- else if (newScreen && shouldRecreate) ++ if (newScreen && shouldRecreate) { + create(true); ++ q->setVisible(visibilityOnDestroy); ++ } + emitScreenChangedRecursion(newScreen); + } + }