Qt5 application crashes when connecting/disconnecting displays (#1083664)

This commit is contained in:
Rex Dieter 2015-07-13 08:46:39 -05:00
parent 971e7e5c5e
commit 5ece80d791
2 changed files with 50 additions and 1 deletions

View File

@ -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 <rdieter@fedoraproject.org> 5.5.0-4
- Qt5 application crashes when connecting/disconnecting displays (#1083664)
* Fri Jul 10 2015 Than Ngo <than@redhat.com> - 5.5.0-3
- add better fix for compile error on big endian

View File

@ -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);
}
}