From d7b52e5dad606a05f56b8d4273b75c529e47b7c1 Mon Sep 17 00:00:00 2001 From: Helio Chissini de Castro Date: Sun, 15 Nov 2015 10:10:58 -0200 Subject: [PATCH 01/62] - Working under all arches now --- qtbase-opensource-src-5.4.0-rc-old_xcb.patch | 196 ------------------ ...pensource-src-5.4.0-rc-old_xkbcommon.patch | 77 ------- ...e-src-5.5.1-qdbusconnection_no_debug.patch | 14 -- 3 files changed, 287 deletions(-) delete mode 100644 qtbase-opensource-src-5.4.0-rc-old_xcb.patch delete mode 100644 qtbase-opensource-src-5.4.0-rc-old_xkbcommon.patch delete mode 100644 qtbase-opensource-src-5.5.1-qdbusconnection_no_debug.patch diff --git a/qtbase-opensource-src-5.4.0-rc-old_xcb.patch b/qtbase-opensource-src-5.4.0-rc-old_xcb.patch deleted file mode 100644 index 8a6437b..0000000 --- a/qtbase-opensource-src-5.4.0-rc-old_xcb.patch +++ /dev/null @@ -1,196 +0,0 @@ -diff --git a/configure b/configure -index 5ad29bb..7ff0df1 100644 ---- a/configure -+++ b/configure -@@ -5060,10 +5060,8 @@ if [ "$CFG_XCB" != "no" ]; then - QMAKE_LIBS_XCB="`$PKG_CONFIG --libs $XCB_PACKAGES 2>/dev/null`" - fi - -- # libxcb version 1.10 was the first version that enables xcb-xkb by default, -- # therefore the minimal xcb-xkb version we support is 1.10 - CFG_XKB=no -- if $PKG_CONFIG --exists "xcb-xkb >= 1.10" 2>/dev/null; then -+ if $PKG_CONFIG --exists "xcb-xkb" 2>/dev/null; then - QMAKE_CFLAGS_XKB="`$PKG_CONFIG --cflags xcb xcb-xkb 2>/dev/null`" - QMAKE_LIBS_XKB="`$PKG_CONFIG --libs xcb xcb-xkb 2>/dev/null`" - if compileTest qpa/xcb-xkb "xcb-xkb" $QMAKE_CFLAGS_XKB $QMAKE_LIBS_XKB; then -@@ -5172,16 +5170,16 @@ MIN_REQ_XKBCOMMON="0.4.1" - if [ "$CFG_XCB" != "no" ]; then - if [ "$CFG_XKBCOMMON" != "no" ] && [ "$CFG_XKBCOMMON" != "qt" ]; then - # Check if there is a suitable system-wide xkbcommon -- if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists "xkbcommon xkbcommon-x11 >= $MIN_REQ_XKBCOMMON" 2>/dev/null; then -- QMAKE_CFLAGS_XKBCOMMON="`$PKG_CONFIG --cflags xkbcommon xkbcommon-x11 2>/dev/null`" -- QMAKE_LIBS_XKBCOMMON="`$PKG_CONFIG --libs xkbcommon xkbcommon-x11 2>/dev/null`" -+ if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists "xkbcommon >= $MIN_REQ_XKBCOMMON" 2>/dev/null; then -+ QMAKE_CFLAGS_XKBCOMMON="`$PKG_CONFIG --cflags xkbcommon 2>/dev/null`" -+ QMAKE_LIBS_XKBCOMMON="`$PKG_CONFIG --libs xkbcommon 2>/dev/null`" - - QMakeVar set QMAKE_CFLAGS_XKBCOMMON "$QMAKE_CFLAGS_XKBCOMMON" - QMakeVar set QMAKE_LIBS_XKBCOMMON "$QMAKE_LIBS_XKBCOMMON" - CFG_XKBCOMMON=system - elif [ "$CFG_XKBCOMMON" = "system" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then -- echo " xkbcommon support cannot be enabled because either xkbcommon or " -- echo " xkbcommon-x11 >= $MIN_REQ_XKBCOMMON was not found via pkg-config!" -+ echo " xkbcommon support cannot be enabled because xkbcommon" -+ echo " >= $MIN_REQ_XKBCOMMON was not found via pkg-config!" - [ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -force-pkg-config?" - echo " Turn on verbose messaging (-v) to $0 to see the final report." - echo " If you believe this message is in error you may use the continue" -diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp -index 5510c3b..4762977 100644 ---- a/src/plugins/platforms/xcb/qxcbconnection.cpp -+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp -@@ -1761,7 +1761,7 @@ void QXcbConnection::initializeXKB() - xcb_xkb_use_extension_cookie_t xkb_query_cookie; - xcb_xkb_use_extension_reply_t *xkb_query; - -- xkb_query_cookie = xcb_xkb_use_extension(c, XKB_X11_MIN_MAJOR_XKB_VERSION, XKB_X11_MIN_MINOR_XKB_VERSION); -+ xkb_query_cookie = xcb_xkb_use_extension(c, XCB_XKB_MAJOR_VERSION, XCB_XKB_MINOR_VERSION); - xkb_query = xcb_xkb_use_extension_reply(c, xkb_query_cookie, 0); - - if (!xkb_query) { -diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp -index 5fb7457..487c3ba 100644 ---- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp -+++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp -@@ -693,50 +693,65 @@ void QXcbKeyboard::updateKeymap() - // log only critical errors, we do our own error logging from printKeymapError() - xkb_context_set_log_level(xkb_context, (xkb_log_level)XKB_LOG_LEVEL_CRITICAL); - } -- // update xkb keymap object -- xkb_keymap_unref(xkb_keymap); -- xkb_keymap = 0; - -- struct xkb_state *new_state = 0; --#ifndef QT_NO_XKB -- if (connection()->hasXKB()) { -- xkb_keymap = xkb_x11_keymap_new_from_device(xkb_context, xcb_connection(), core_device_id, (xkb_keymap_compile_flags)0); -- if (xkb_keymap) { -- // Create a new keyboard state object for a keymap -- new_state = xkb_x11_state_new_from_device(xkb_keymap, xcb_connection(), core_device_id); -- } -- } --#endif -+ readXKBConfig(); -+ // Compile a keymap from RMLVO (rules, models, layouts, variants and options) names -+ if (xkb_keymap) -+ xkb_keymap_unref(xkb_keymap); -+ -+ xkb_keymap = xkb_keymap_new_from_names(xkb_context, &xkb_names, (xkb_keymap_compile_flags)0); - if (!xkb_keymap) { -- // Compile a keymap from RMLVO (rules, models, layouts, variants and options) names -- readXKBConfig(); -+ // last fallback is to used hard-coded keymap name, see DEFAULT_XKB_* in xkbcommon.pri -+ qWarning() << "Qt: Could not determine keyboard configuration data" -+ " from X server, will use hard-coded keymap configuration."; -+ clearXKBConfig(); - xkb_keymap = xkb_keymap_new_from_names(xkb_context, &xkb_names, (xkb_keymap_compile_flags)0); -- if (!xkb_keymap) { -- // last fallback is to used hard-coded keymap name, see DEFAULT_XKB_* in xkbcommon.pri -- qWarning() << "Qt: Could not determine keyboard configuration data" -- " from X server, will use hard-coded keymap configuration."; -- clearXKBConfig(); -- xkb_keymap = xkb_keymap_new_from_names(xkb_context, &xkb_names, (xkb_keymap_compile_flags)0); -- } -- if (xkb_keymap) { -- new_state = xkb_state_new(xkb_keymap); -- } else { -- printKeymapError("Qt: Failed to compile a keymap!"); -- m_config = false; -- return; -- } -- - } -+ if (!xkb_keymap) { -+ printKeymapError("Qt: Failed to compile a keymap!"); -+ m_config = false; -+ return; -+ } -+ -+ struct xkb_state *new_state = xkb_state_new(xkb_keymap); - if (!new_state) { - qWarning("Qt: Failed to create xkb state!"); - m_config = false; - return; - } -- // update xkb state object -- xkb_state_unref(xkb_state); -- xkb_state = new_state; -- if (!connection()->hasXKB()) -- updateXKBMods(); -+ -+ if (xkb_state) { -+ xkb_state_unref(xkb_state); -+ xkb_state = new_state; -+ } else { -+ xkb_state = new_state; -+#ifndef QT_NO_XKB -+ if (connection()->hasXKB()) { -+ // get initial state from the X server (and keep it up-to-date at all times) -+ xcb_xkb_get_state_cookie_t state; -+ xcb_xkb_get_state_reply_t *init_state; -+ -+ xcb_connection_t *c = xcb_connection(); -+ state = xcb_xkb_get_state(c, XCB_XKB_ID_USE_CORE_KBD); -+ init_state = xcb_xkb_get_state_reply(c, state, 0); -+ if (!init_state) { -+ qWarning("Qt: couldn't retrieve an initial keyboard state"); -+ return; -+ } -+ /* The xkb keyboard state is comprised of the state of all keyboard modifiers, -+ the keyboard group, and the state of the pointer buttons */ -+ xkb_state_update_mask(xkb_state, -+ init_state->baseMods, -+ init_state->latchedMods, -+ init_state->lockedMods, -+ init_state->baseGroup, -+ init_state->latchedGroup, -+ init_state->lockedGroup); -+ free(init_state); -+ } else -+#endif -+ updateXKBMods(); -+ } - - checkForLatinLayout(); - } -@@ -1097,11 +1112,23 @@ QXcbKeyboard::QXcbKeyboard(QXcbConnection *connection) - if (connection->hasXKB()) { - updateVModMapping(); - updateVModToRModMapping(); -- core_device_id = xkb_x11_get_core_keyboard_device_id(xcb_connection()); -- if (core_device_id == -1) { -+ -+ // get the core keyboard id -+ xcb_xkb_get_device_info_cookie_t device_id_cookie; -+ xcb_xkb_get_device_info_reply_t *device_id; -+ -+ device_id_cookie = xcb_xkb_get_device_info(xcb_connection(), -+ XCB_XKB_ID_USE_CORE_KBD, -+ 0, 0, 0, 0, 0, 0); -+ -+ device_id = xcb_xkb_get_device_info_reply(xcb_connection(), device_id_cookie, 0); -+ if (!device_id) { - qWarning("Qt: couldn't get core keyboard device info"); - return; - } -+ -+ core_device_id = device_id->deviceID; -+ free(device_id); - } else { - #endif - m_key_symbols = xcb_key_symbols_alloc(xcb_connection()); -diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.h b/src/plugins/platforms/xcb/qxcbkeyboard.h -index 9f1cf16..3beee7b 100644 ---- a/src/plugins/platforms/xcb/qxcbkeyboard.h -+++ b/src/plugins/platforms/xcb/qxcbkeyboard.h -@@ -39,9 +39,6 @@ - #include - - #include --#ifndef QT_NO_XKB --#include --#endif - - #include - diff --git a/qtbase-opensource-src-5.4.0-rc-old_xkbcommon.patch b/qtbase-opensource-src-5.4.0-rc-old_xkbcommon.patch deleted file mode 100644 index ea7c60a..0000000 --- a/qtbase-opensource-src-5.4.0-rc-old_xkbcommon.patch +++ /dev/null @@ -1,77 +0,0 @@ -diff -ur qtbase-opensource-src-5.4.0-rc-old_xcb/configure qtbase-opensource-src-5.4.0-rc-old_xkbcommon/configure ---- qtbase-opensource-src-5.4.0-rc-old_xcb/configure 2014-11-29 03:07:40.000000000 +0100 -+++ qtbase-opensource-src-5.4.0-rc-old_xkbcommon/configure 2014-11-29 03:32:16.000000000 +0100 -@@ -5144,7 +5144,7 @@ - fi - - # Detect libxkbcommon --MIN_REQ_XKBCOMMON="0.4.1" -+MIN_REQ_XKBCOMMON="0.3.0" - # currently only xcb platform plugin supports building xkbcommon - if [ "$CFG_XCB" != "no" ]; then - if [ "$CFG_XKBCOMMON" != "no" ] && [ "$CFG_XKBCOMMON" != "qt" ]; then -diff -ur qtbase-opensource-src-5.4.0-rc-old_xcb/src/plugins/platforms/xcb/qxcbkeyboard.cpp qtbase-opensource-src-5.4.0-rc-old_xkbcommon/src/plugins/platforms/xcb/qxcbkeyboard.cpp ---- qtbase-opensource-src-5.4.0-rc-old_xcb/src/plugins/platforms/xcb/qxcbkeyboard.cpp 2014-11-29 03:29:53.000000000 +0100 -+++ qtbase-opensource-src-5.4.0-rc-old_xkbcommon/src/plugins/platforms/xcb/qxcbkeyboard.cpp 2014-11-29 03:35:36.000000000 +0100 -@@ -971,7 +971,7 @@ - } - - QList result; -- int baseQtKey = keysymToQtKey(sym, modifiers, lookupString(kb_state, keycode)); -+ int baseQtKey = keysymToQtKey(sym, modifiers, keysymToUnicode(sym)); - result += (baseQtKey + modifiers); // The base key is _always_ valid, of course - - xkb_mod_index_t shiftMod = xkb_keymap_mod_get_index(xkb_keymap, "Shift"); -@@ -1008,7 +1008,7 @@ - continue; - - Qt::KeyboardModifiers mods = modifiers & ~neededMods; -- qtKey = keysymToQtKey(sym, mods, lookupString(kb_state, keycode)); -+ qtKey = keysymToQtKey(sym, mods, keysymToUnicode(sym)); - if (!qtKey || qtKey == baseQtKey) - continue; - -@@ -1462,7 +1462,7 @@ - return; - } - -- QString string = lookupString(xkb_state, code); -+ QString string = keysymToUnicode(sym); - int count = string.size(); - string.truncate(count); - -@@ -1535,12 +1535,18 @@ - } - } - --QString QXcbKeyboard::lookupString(struct xkb_state *state, xcb_keycode_t code) const -+QString QXcbKeyboard::keysymToUnicode(xcb_keysym_t sym) const - { - QByteArray chars; -- chars.resize(1 + xkb_state_key_get_utf8(state, code, 0, 0)); -- // equivalent of XLookupString -- xkb_state_key_get_utf8(state, code, chars.data(), chars.size()); -+ int bytes; -+ chars.resize(7); -+ -+ bytes = xkb_keysym_to_utf8(sym, chars.data(), chars.size()); -+ -+ if (bytes == -1) -+ qWarning("QXcbKeyboard::handleKeyEvent - buffer too small"); -+ chars.resize(bytes-1); -+ - return QString::fromUtf8(chars); - } - -diff -ur qtbase-opensource-src-5.4.0-rc-old_xcb/src/plugins/platforms/xcb/qxcbkeyboard.h qtbase-opensource-src-5.4.0-rc-old_xkbcommon/src/plugins/platforms/xcb/qxcbkeyboard.h ---- qtbase-opensource-src-5.4.0-rc-old_xcb/src/plugins/platforms/xcb/qxcbkeyboard.h 2014-11-29 03:07:40.000000000 +0100 -+++ qtbase-opensource-src-5.4.0-rc-old_xkbcommon/src/plugins/platforms/xcb/qxcbkeyboard.h 2014-11-29 03:32:16.000000000 +0100 -@@ -75,7 +75,7 @@ - void handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time); - - void resolveMaskConflicts(); -- QString lookupString(struct xkb_state *state, xcb_keycode_t code) const; -+ QString keysymToUnicode(xcb_keysym_t sym) const; - int keysymToQtKey(xcb_keysym_t keysym) const; - int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, QString text) const; - void printKeymapError(const char *error) const; diff --git a/qtbase-opensource-src-5.5.1-qdbusconnection_no_debug.patch b/qtbase-opensource-src-5.5.1-qdbusconnection_no_debug.patch deleted file mode 100644 index 62ac784..0000000 --- a/qtbase-opensource-src-5.5.1-qdbusconnection_no_debug.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -up qtbase-opensource-src-5.4.1/src/dbus/qdbusconnection.cpp.qdbusconnection_no_debug qtbase-opensource-src-5.4.1/src/dbus/qdbusconnection.cpp ---- qtbase-opensource-src-5.4.1/src/dbus/qdbusconnection.cpp.qdbusconnection_no_debug 2015-02-16 22:56:38.000000000 -0600 -+++ qtbase-opensource-src-5.4.1/src/dbus/qdbusconnection.cpp 2015-04-25 10:48:52.099668703 -0500 -@@ -1056,8 +1056,10 @@ public: - // make sure this connection is running on the main thread - QCoreApplication *instance = QCoreApplication::instance(); - if (!instance) { -+#ifndef QT_NO_DEBUG - qWarning("QDBusConnection: %s D-Bus connection created before QCoreApplication. Application may misbehave.", - type == SessionBus ? "session" : type == SystemBus ? "system" : "generic"); -+#endif - } else if (QDBusConnectionPrivate::d(*this)) { - QDBusConnectionPrivate::d(*this)->moveToThread(instance->thread()); - } From 243e1453dd46d3263f78fab5595ad257d9de1952 Mon Sep 17 00:00:00 2001 From: Helio Chissini de Castro Date: Sun, 15 Nov 2015 10:11:10 -0200 Subject: [PATCH 02/62] - Working under all arches now --- qt5-qtbase.spec | 144 +++++------------- qtbase-multilib_optflags.patch | 60 ++++---- ...ensource-src-5.5-disconnect_displays.patch | 25 +-- 3 files changed, 70 insertions(+), 159 deletions(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index dad4e2d..0a253c0 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -1,12 +1,7 @@ # See http://bugzilla.redhat.com/223663 -%define multilib_archs x86_64 %{ix86} ppc64 ppc s390x s390 sparc64 sparcv9 ppc64le +%define multilib_archs x86_64 %{ix86} ppc64 ppc ppc64le s390x s390 sparc64 sparcv9 %define multilib_basearchs x86_64 ppc64 s390x sparc64 ppc64le -# use valgrind to debug qdoc HTML generation -%ifarch %{ix86} x86_64 ppc ppc64 ppc64le s390x armv7hl aarch64 -%global valgrind 1 -%endif - # support qtchooser (adds qtchooser .conf file) %define qtchooser 1 %if 0%{?qtchooser} @@ -20,38 +15,26 @@ %global rpm_macros_dir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) -## set to 1 to enable bootstrap -#global bootstrap 1 - %if 0%{?fedora} > 21 # use external qt_settings pkg %global qt_settings 1 %endif -# define to build docs, need to undef this for bootstrapping -# where qt5-qttools builds are not yet available -# only primary archs (for now), allow secondary to bootstrap -%if ! 0%{?bootstrap} -%ifarch %{arm} %{ix86} x86_64 %define docs 1 -%endif -%endif %define examples 1 -## define prerelease rc1 +%define prerelease beta1 Summary: Qt5 - QtBase components Name: qt5-qtbase -Version: 5.5.1 -Release: 2%{?dist} +Version: 5.6.0 +Release: 0.2%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions Url: http://qt-project.org/ -Source0: http://download.qt.io/official_releases/qt/5.5/%{version}%{?prerelease:-%{prerelease}}/submodules/%{qt_module}-opensource-src-%{version}%{?prerelease:-%{prerelease}}.tar.xz - -Source2: qdoc.valgrind +Source0: http://download.qt.io/official_releases/qt/5.6/%{version}%{?prerelease:-%{prerelease}}/submodules/%{qt_module}-opensource-src-%{version}%{?prerelease:-%{prerelease}}.tar.xz # header file to workaround multilib issue # https://bugzilla.redhat.com/show_bug.cgi?id=1036956 @@ -61,12 +44,6 @@ Source5: qconfig-multilib.h # QT_XCB_FORCE_SOFTWARE_OPENGL for them Source6: 10-qt5-check-opengl2.sh -# support the old version of libxcb and the resulting lack of libxkbcommon-x11 -# in F19 and F20 -Patch0: qtbase-opensource-src-5.4.0-rc-old_xcb.patch -# support the old version of libxkbcommon in F19 -Patch1: qtbase-opensource-src-5.4.0-rc-old_xkbcommon.patch - # support multilib optflags Patch2: qtbase-multilib_optflags.patch @@ -76,10 +53,6 @@ Patch4: qtbase-opensource-src-5.3.2-QTBUG-35459.patch # unconditionally enable freetype lcdfilter support Patch12: qtbase-opensource-src-5.2.0-enable_ft_lcdfilter.patch -# hack out largely useless (to users) warnings about qdbusconnection -# (often in kde apps), keep an eye on https://git.reviewboard.kde.org/r/103699/ -Patch25: qtbase-opensource-src-5.5.1-qdbusconnection_no_debug.patch - # upstreamable patches # support poll # https://bugreports.qt-project.org/browse/QTBUG-27195 @@ -96,7 +69,7 @@ Patch51: qtbase-opensource-src-5.5-disconnect_displays.patch Patch100: qtbase-opensource-src-5.4.0-QTBUG-43057.patch # macros, be mindful to keep sync'd with macros.qt5 -Source1: macros.qt5 +Source10: macros.qt5 %define _qt5 %{name} %define _qt5_prefix %{_libdir}/qt5 %define _qt5_archdatadir %{_libdir}/qt5 @@ -123,10 +96,6 @@ Source1: macros.qt5 # RPM drag in gtk2 as a dependency for the GTK+ 2 dialog support. %global __requires_exclude_from ^%{_qt5_plugindir}/platformthemes/.*$ -# for doc hacks -%if 0%{?valgrind} -BuildRequires: valgrind -%endif # for %%check BuildRequires: cmake BuildRequires: cups-devel @@ -146,6 +115,7 @@ BuildRequires: pkgconfig(fontconfig) BuildRequires: pkgconfig(gl) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(gtk+-2.0) +BuildRequires: pkgconfig(libproxy-1.0) # xcb-sm BuildRequires: pkgconfig(ice) pkgconfig(sm) BuildRequires: pkgconfig(libpng) @@ -155,29 +125,11 @@ BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(libpulse) pkgconfig(libpulse-mainloop-glib) %if 0%{?fedora} %global xkbcommon -system-xkbcommon -%if 0%{?fedora} > 20 -# libinput is currently f21+ only -%global libinput 1 BuildRequires: pkgconfig(libinput) BuildRequires: pkgconfig(xcb-xkb) >= 1.10 BuildRequires: pkgconfig(xkbcommon) >= 0.4.1 BuildRequires: pkgconfig(xkbcommon-x11) >= 0.4.1 %else -# apply patch to support older version of xcb, resulting lack of xkbcommon-x11 -%global old_xcb 1 -%if 0%{?fedora} > 19 -# Fedora 20 -BuildRequires: pkgconfig(xkbcommon) >= 0.4.1 -%global xkbcommon_version %(pkg-config --modversion xkbcommon 2> /dev/null || echo '0.4.1') -Requires: libxkbcommon%{?_isa} >= %{xkbcommon_version} -%else -# Fedora 19 and older -BuildRequires: pkgconfig(xkbcommon) -# apply patch to support older version of xkbcommon -%global old_xkbcommon 1 -%endif -%endif -%else # not Fedora %global xkbcommon -qt-xkbcommon Provides: bundled(libxkbcommon) = 0.4.1 @@ -190,11 +142,7 @@ BuildRequires: pkgconfig(egl) BuildRequires: pkgconfig(gbm) BuildRequires: pkgconfig(glesv2) BuildRequires: pkgconfig(sqlite3) >= 3.7 -%define sqlite -system-sqlite -%if 0%{?fedora} > 20 -BuildRequires: pkgconfig(harfbuzz) >= 0.9.31 -%define harfbuzz -system-harfbuzz -%endif +BuildRequires: pkgconfig(harfbuzz) >= 1.0.6 BuildRequires: pkgconfig(icu-i18n) BuildRequires: pkgconfig(libpcre) >= 8.30 %define pcre -system-pcre @@ -205,6 +153,9 @@ BuildRequires: libicu-devel %endif BuildRequires: pkgconfig(xcb) pkgconfig(xcb-glx) pkgconfig(xcb-icccm) pkgconfig(xcb-image) pkgconfig(xcb-keysyms) pkgconfig(xcb-renderutil) BuildRequires: pkgconfig(zlib) +# For the very first bootstrap of 5.6 we need valgring for now, as qt5-qdoc brand new +# splitted package script still using it +BuildRequires: valgrind %if 0%{?qtchooser} %if 0%{?fedora} @@ -261,6 +212,7 @@ Summary: API documentation for %{name} License: GFDL Requires: %{name} = %{version}-%{release} BuildRequires: qt5-qhelpgenerator +BuildRequires: qt5-qdoc BuildArch: noarch %description doc %{summary}. @@ -341,19 +293,12 @@ Qt5 libraries used for drawing widgets and OpenGL items. %prep %setup -q -n %{qt_module}-opensource-src-%{version}%{?prerelease:-%{prerelease}} -%if 0%{?old_xcb} -%patch0 -p1 -b .old_xcb -%if 0%{?old_xkbcommon} -%patch1 -p1 -b .old_xkbcommon -%endif -%endif %patch2 -p1 -b .multilib_optflags # drop backup file(s), else they get installed too, http://bugzilla.redhat.com/639463 rm -fv mkspecs/linux-g++*/qmake.conf.multilib-optflags %patch4 -p1 -b .QTBUG-35459 %patch12 -p1 -b .enable_ft_lcdfilter -%patch25 -p1 -b .qdbusconnection_no_debug #patch50 -p1 -b .poll %patch51 -p1 -b .disconnect_displays @@ -376,13 +321,14 @@ sed -i -e "s|^\(QMAKE_LFLAGS_RELEASE.*\)|\1 $RPM_LD_FLAGS|" \ # undefine QMAKE_STRIP (and friends), so we get useful -debuginfo pkgs (#1065636) sed -i -e 's|^\(QMAKE_STRIP.*=\).*$|\1|g' mkspecs/common/linux.conf +%if %{prerelease} +bin/syncqt.pl -version %{version} +%endif + # move some bundled libs to ensure they're not accidentally used pushd src/3rdparty mkdir UNUSED -mv freetype libjpeg libpng zlib xcb UNUSED/ -%if "%{?sqlite}" == "-system-sqlite" -mv sqlite UNUSED/ -%endif +mv freetype libjpeg libpng zlib xcb sqlite UNUSED/ popd # builds failing mysteriously on f20 @@ -390,6 +336,7 @@ popd # check to ensure that can't happen -- rex test -x configure || chmod +x configure +# %build # limit -reduce-relocations to %%ix86 x86_64 archs, https://bugreports.qt-project.org/browse/QTBUG-36129 @@ -401,7 +348,10 @@ test -x configure || chmod +x configure -bindir %{_qt5_bindir} \ -datadir %{_qt5_datadir} \ -docdir %{_qt5_docdir} \ +%if 0%{?examples} -examplesdir %{_qt5_examplesdir} \ + -no-compile-examples \ +%endif -headerdir %{_qt5_headerdir} \ -importdir %{_qt5_importdir} \ -libdir %{_qt5_libdir} \ @@ -422,7 +372,6 @@ test -x configure || chmod +x configure -icu \ -openssl-linked \ -optimized-qmake \ - %{!?examples:-nomake examples} \ -nomake tests \ -no-pch \ -no-rpath \ @@ -434,11 +383,11 @@ test -x configure || chmod +x configure %ifarch %{ix86} x86_64 -reduce-relocations \ %endif - %{?harfbuzz} \ + -system-harfbuzz \ -system-libjpeg \ -system-libpng \ + -system-sqlite \ %{?pcre} \ - %{?sqlite} \ %{?tds} \ %{?xkbcommon} \ -system-zlib \ @@ -448,23 +397,7 @@ test -x configure || chmod +x configure make %{?_smp_mflags} %if 0%{?docs} -# qdoc -# wierd but necessary, to force use of just-built qdoc -rm -fv qmake/Makefile.qmake-docs src/corelib/Makefile -pushd src; ../bin/qmake; make sub-qdoc; popd -pushd src/corelib; ../../bin/qmake; popd -pushd src/xml; ../../bin/qmake; popd -# HACK to avoid multilib conflicts in noarch content -# see also https://bugreports.qt-project.org/browse/QTBUG-42071 -QT_HASH_SEED=0; export QT_HASH_SEED -%if 0%{?valgrind} -make html_docs || (\ - mv bin/qdoc bin/qdoc.orig && install %{SOURCE2} bin/qdoc && \ - make html_docs) - [ -e bin/qdoc/orig ] && mv bin/qdoc.orig bin/qdoc -f -%else make html_docs -%endif make qch_docs %endif @@ -498,11 +431,11 @@ translationdir=%{_qt5_translationdir} Name: Qt5 Description: Qt5 Configuration -Version: 5.5.1 +Version: 5.6.0 EOF # rpm macros -install -p -m644 -D %{SOURCE1} \ +install -p -m644 -D %{SOURCE10} \ %{buildroot}%{rpm_macros_dir}/macros.qt5 sed -i \ -e "s|@@NAME@@|%{name}|g" \ @@ -648,8 +581,10 @@ fi %dir %{_qt5_libdir}/cmake/Qt5Test/ %dir %{_qt5_libdir}/cmake/Qt5Widgets/ %dir %{_qt5_libdir}/cmake/Qt5Xml/ +%if 0%{?docs} %dir %{_qt5_docdir}/ %{_qt5_docdir}/global/ +%endif %{_qt5_importdir}/ %{_qt5_translationdir}/ %dir %{_qt5_prefix}/ @@ -685,11 +620,6 @@ fi %doc LICENSE.FDL %doc dist/README dist/changes-5.* %{_qt5_docdir}/*.qch -%{_qt5_docdir}/qdoc/ -%if 0%{?examples} -# included in -examples instead, see bug #1212750 -%exclude %{_qt5_docdir}/qdoc/examples-manifest.xml -%endif %{_qt5_docdir}/qmake/ %{_qt5_docdir}/qtconcurrent/ %{_qt5_docdir}/qtcore/ @@ -713,7 +643,6 @@ fi %{_bindir}/moc* %{_bindir}/qdbuscpp2xml* %{_bindir}/qdbusxml2cpp* -%{_bindir}/qdoc* %{_bindir}/qmake* %{_bindir}/rcc* %{_bindir}/syncqt* @@ -722,7 +651,6 @@ fi %{_qt5_bindir}/moc* %{_qt5_bindir}/qdbuscpp2xml* %{_qt5_bindir}/qdbusxml2cpp* -%{_qt5_bindir}/qdoc* %{_qt5_bindir}/qmake* %{_qt5_bindir}/rcc* %{_qt5_bindir}/syncqt* @@ -820,10 +748,6 @@ fi %if 0%{?examples} %files examples -%if 0%{?docs} -%dir %{_qt5_docdir}/qdoc/ -%{_qt5_docdir}/qdoc/examples-manifest.xml -%endif %{_qt5_examplesdir}/ %endif @@ -867,7 +791,7 @@ fi %{_qt5_plugindir}/generic/libqevdevmouseplugin.so %{_qt5_plugindir}/generic/libqevdevtabletplugin.so %{_qt5_plugindir}/generic/libqevdevtouchplugin.so -%if 0%{?libinput} +%if 0%{?fedora} %{_qt5_plugindir}/generic/libqlibinputplugin.so %{_qt5_libdir}/cmake/Qt5Gui/Qt5Gui_QLibInputPlugin.cmake %endif @@ -917,6 +841,18 @@ fi %changelog +* Fri Nov 13 2015 Helio Chissini de Castro - 5.6.0-0.2 +- Valgrind still needed as buildreq due recent split qdoc package, but we can get rid of + specific arch set. +- Added missing libproxy buildreq +- Epel and RHEL doesn't have libinput, so a plugin need to be excluded for this distros + +* Tue Nov 03 2015 Helio Chissini de Castro - 5.6.0-0.1 +- Start to implement 5.6.0 beta + +* Tue Nov 03 2015 Helio Chissini de Castro - 5.6.0-0.1 +- Start to implement 5.6.0 beta + * Thu Oct 15 2015 Helio Chissini de Castro - 5.5.1-2 - Update to final release 5.5.1 diff --git a/qtbase-multilib_optflags.patch b/qtbase-multilib_optflags.patch index 3d32215..5498e79 100644 --- a/qtbase-multilib_optflags.patch +++ b/qtbase-multilib_optflags.patch @@ -1,39 +1,33 @@ -diff --git a/mkspecs/linux-g++-32/qmake.conf b/mkspecs/linux-g++-32/qmake.conf -index 340aa85..571a559 100644 ---- a/mkspecs/linux-g++-32/qmake.conf -+++ b/mkspecs/linux-g++-32/qmake.conf -@@ -9,6 +9,8 @@ QMAKE_INCREMENTAL_STYLE = sublib - QMAKE_CFLAGS = -m32 - QMAKE_LFLAGS = -m32 - -+QMAKE_CFLAGS_RELEASE += -O2 -+ - include(../common/linux.conf) - include(../common/gcc-base-unix.conf) - include(../common/g++-unix.conf) -diff --git a/mkspecs/linux-g++-64/qmake.conf b/mkspecs/linux-g++-64/qmake.conf -index 36fb6a8..9a07595 100644 ---- a/mkspecs/linux-g++-64/qmake.conf -+++ b/mkspecs/linux-g++-64/qmake.conf -@@ -12,6 +12,8 @@ QMAKE_INCREMENTAL_STYLE = sublib - QMAKE_CFLAGS = -m64 - QMAKE_LFLAGS = -m64 - -+QMAKE_CFLAGS_RELEASE += -O2 -+ - include(../common/linux.conf) - include(../common/gcc-base-unix.conf) - include(../common/g++-unix.conf) -diff --git a/mkspecs/linux-g++/qmake.conf b/mkspecs/linux-g++/qmake.conf -index 35bce8f..5186f98 100644 ---- a/mkspecs/linux-g++/qmake.conf -+++ b/mkspecs/linux-g++/qmake.conf -@@ -6,6 +6,8 @@ MAKEFILE_GENERATOR = UNIX +diff -r -u a/mkspecs/linux-g++/qmake.conf b/mkspecs/linux-g++/qmake.conf +--- a/mkspecs/linux-g++/qmake.conf 2015-10-30 06:20:01.000000000 -0200 ++++ b/mkspecs/linux-g++/qmake.conf 2015-11-05 11:23:23.230741601 -0200 +@@ -5,6 +5,7 @@ + MAKEFILE_GENERATOR = UNIX CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib - +QMAKE_CFLAGS_RELEASE += -O2 -+ + include(../common/linux.conf) include(../common/gcc-base-unix.conf) +diff -r -u a/mkspecs/linux-g++-32/qmake.conf b/mkspecs/linux-g++-32/qmake.conf +--- a/mkspecs/linux-g++-32/qmake.conf 2015-10-30 06:20:01.000000000 -0200 ++++ b/mkspecs/linux-g++-32/qmake.conf 2015-11-05 11:22:19.761494470 -0200 +@@ -10,6 +10,7 @@ + + QMAKE_CFLAGS = -m32 + QMAKE_LFLAGS = -m32 ++QMAKE_CFLAGS_RELEASE += -O2 + + include(../common/gcc-base-unix.conf) + include(../common/g++-unix.conf) +diff -r -u a/mkspecs/linux-g++-64/qmake.conf b/mkspecs/linux-g++-64/qmake.conf +--- a/mkspecs/linux-g++-64/qmake.conf 2015-10-30 06:20:01.000000000 -0200 ++++ b/mkspecs/linux-g++-64/qmake.conf 2015-11-05 11:22:49.497610248 -0200 +@@ -13,6 +13,7 @@ + + QMAKE_CFLAGS = -m64 + QMAKE_LFLAGS = -m64 ++QMAKE_CFLAGS_RELEASE += -O2 + + include(../common/gcc-base-unix.conf) include(../common/g++-unix.conf) diff --git a/qtbase-opensource-src-5.5-disconnect_displays.patch b/qtbase-opensource-src-5.5-disconnect_displays.patch index 8a751e9..16b47d6 100644 --- a/qtbase-opensource-src-5.5-disconnect_displays.patch +++ b/qtbase-opensource-src-5.5-disconnect_displays.patch @@ -1,25 +1,6 @@ -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 +--- a/src/gui/kernel/qwindow.cpp 2015-10-30 06:20:01.000000000 -0200 ++++ b/src/gui/kernel/qwindow.cpp 2015-11-05 11:31:10.544561171 -0200 +@@ -373,15 +373,14 @@ return; } if (newScreen != topLevelScreen) { From 00a208ef32c6f1f707b6848408fdc729e31cae71 Mon Sep 17 00:00:00 2001 From: Helio Chissini de Castro Date: Wed, 18 Nov 2015 12:08:57 -0200 Subject: [PATCH 03/62] - Get hid of valgring hacks --- qt5-qtbase.spec | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 32e7155..46447bc 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -2,11 +2,6 @@ %define multilib_archs x86_64 %{ix86} ppc64 ppc s390x s390 sparc64 sparcv9 ppc64le %define multilib_basearchs x86_64 ppc64 s390x sparc64 ppc64le -# use valgrind to debug qdoc HTML generation -%ifarch %{ix86} x86_64 ppc ppc64 ppc64le s390x armv7hl aarch64 -%global valgrind 1 -%endif - # support qtchooser (adds qtchooser .conf file) %define qtchooser 1 %if 0%{?qtchooser} @@ -44,15 +39,13 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.5.1 -Release: 8%{?dist} +Release: 9%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions Url: http://qt-project.org/ Source0: http://download.qt.io/official_releases/qt/5.5/%{version}%{?prerelease:-%{prerelease}}/submodules/%{qt_module}-opensource-src-%{version}%{?prerelease:-%{prerelease}}.tar.xz -Source2: qdoc.valgrind - # header file to workaround multilib issue # https://bugzilla.redhat.com/show_bug.cgi?id=1036956 Source5: qconfig-multilib.h @@ -125,10 +118,6 @@ Source1: macros.qt5 # RPM drag in gtk2 as a dependency for the GTK+ 2 dialog support. %global __requires_exclude_from ^%{_qt5_plugindir}/platformthemes/.*$ -# for doc hacks -%if 0%{?valgrind} -BuildRequires: valgrind -%endif # for %%check BuildRequires: cmake BuildRequires: cups-devel @@ -457,24 +446,21 @@ test -x configure || chmod +x configure make %{?_smp_mflags} %if 0%{?docs} + +# HACK to avoid multilib conflicts in noarch content +# see also https://bugreports.qt-project.org/browse/QTBUG-42071 +QT_HASH_SEED=0; export QT_HASH_SEED + # qdoc -# wierd but necessary, to force use of just-built qdoc +# weird but necessary, to force use of just-built qdoc rm -fv qmake/Makefile.qmake-docs src/corelib/Makefile pushd src; ../bin/qmake; make sub-qdoc; popd pushd src/corelib; ../../bin/qmake; popd pushd src/xml; ../../bin/qmake; popd -# HACK to avoid multilib conflicts in noarch content -# see also https://bugreports.qt-project.org/browse/QTBUG-42071 -QT_HASH_SEED=0; export QT_HASH_SEED -%if 0%{?valgrind} -make html_docs || (\ - mv bin/qdoc bin/qdoc.orig && install %{SOURCE2} bin/qdoc && \ - make html_docs) - [ -e bin/qdoc/orig ] && mv bin/qdoc.orig bin/qdoc -f -%else + make html_docs -%endif make qch_docs + %endif @@ -932,6 +918,9 @@ fi %changelog +* Wed Nov 18 2015 Helio Chissini de Castro - 5.5.1-9 +- Get rid of valgrind hack. It sort out that we don't need it anymore + * Mon Nov 09 2015 Helio Chissini de Castro - 5.5.1-8 - qt5-qdoc need requires >= current version, otherwise will prevent the usage further when moved to qttools From 3b0365138e22cdc05a22b6e791f15655b70857dc Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Wed, 25 Nov 2015 07:32:56 -0600 Subject: [PATCH 04/62] drop unused qdoc.valgrind --- qdoc.valgrind | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 qdoc.valgrind diff --git a/qdoc.valgrind b/qdoc.valgrind deleted file mode 100644 index 4029563..0000000 --- a/qdoc.valgrind +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# run process through valgrind instead - -DIRNAME=$(dirname $0) -set -x -valgrind ${DIRNAME}/qdoc.orig $@ From d867910e4452bdbf866f25febcd630e5c967c8ea Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Wed, 25 Nov 2015 08:15:22 -0600 Subject: [PATCH 05/62] old sources --- .gitignore | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitignore b/.gitignore index fbfb51e..a86ab77 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1 @@ -/qtbase-opensource-src-5.4.2.tar.xz -/qtbase-opensource-src-5.5.0.tar.xz -/qtbase-opensource-src-5.5.1-rc1.tar.xz /qtbase-opensource-src-5.5.1.tar.xz From 7f6316426fbd47f931b726353ed6caf4f1a6f6df Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Wed, 25 Nov 2015 08:15:30 -0600 Subject: [PATCH 06/62] add bz reference --- qt5-qtbase.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 46447bc..c281b2f 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -919,7 +919,7 @@ fi %changelog * Wed Nov 18 2015 Helio Chissini de Castro - 5.5.1-9 -- Get rid of valgrind hack. It sort out that we don't need it anymore +- Get rid of valgrind hack. It sort out that we don't need it anymore (#1211203) * Mon Nov 09 2015 Helio Chissini de Castro - 5.5.1-8 - qt5-qdoc need requires >= current version, otherwise will prevent the usage further when moved to qttools From 83f0aeaec2d72c8ac063f5a5fb596df57f383583 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Wed, 25 Nov 2015 08:17:04 -0600 Subject: [PATCH 07/62] devel: Requires: redhat-rpm-config (#1248174) --- qt5-qtbase.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index c281b2f..ffc4f2a 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -39,7 +39,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.5.1 -Release: 9%{?dist} +Release: 10%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -245,6 +245,10 @@ Requires: qt5-qdoc Requires: pkgconfig(egl) %endif Requires: pkgconfig(gl) +%if 0%{?fedora} > 22 +# https://bugzilla.redhat.com/show_bug.cgi?id=1248174 +Requires: redhat-rpm-config +%endif %description devel %{summary}. @@ -918,6 +922,9 @@ fi %changelog +* Wed Nov 25 2015 Rex Dieter 5.5.1-10 +- -devel: Requires: redhat-rpm-config (#1248174) + * Wed Nov 18 2015 Helio Chissini de Castro - 5.5.1-9 - Get rid of valgrind hack. It sort out that we don't need it anymore (#1211203) From 341f22d36003454712d7bbebc1ba8e673020f27c Mon Sep 17 00:00:00 2001 From: Helio Chissini de Castro Date: Sat, 5 Dec 2015 20:47:59 +0100 Subject: [PATCH 08/62] - Uploading 5.6. beta 2 --- .gitignore | 1 + qt5-qtbase.spec | 53 +- ...ensource-src-5.6.0-xcb-gerrit-138201.patch | 704 ++++++++++++++++++ sources | 2 +- 4 files changed, 742 insertions(+), 18 deletions(-) create mode 100644 qtbase-opensource-src-5.6.0-xcb-gerrit-138201.patch diff --git a/.gitignore b/.gitignore index a86ab77..6ba87aa 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /qtbase-opensource-src-5.5.1.tar.xz +/qtbase-opensource-src-5.6.0-beta2.tar.xz diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 323e016..d905400 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -22,14 +22,12 @@ %define docs 1 -%define examples 1 - -%define prerelease beta1 +%define prerelease beta2 Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.2%{?dist} +Release: 0.3%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -63,6 +61,10 @@ Patch50: qt5-poll.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1083664 Patch51: qtbase-opensource-src-5.5-disconnect_displays.patch +# xcb: QScreen is a placeholder whenever there are no outputs connected +# https://codereview.qt-project.org/#/c/138201/ +Patch52: qtbase-opensource-src-5.6.0-xcb-gerrit-138201.patch + ## upstream patches # workaround https://bugreports.qt-project.org/browse/QTBUG-43057 # 'make docs' crash on el6, use qSort instead of std::sort @@ -203,6 +205,11 @@ Requires: %{name}-gui%{?_isa} Requires: pkgconfig(egl) %endif Requires: pkgconfig(gl) +%if 0%{?fedora} > 22 +# https://bugzilla.redhat.com/show_bug.cgi?id=1248174 +Requires: redhat-rpm-config +%endif + %description devel %{summary}. @@ -300,21 +307,16 @@ rm -fv mkspecs/linux-g++*/qmake.conf.multilib-optflags %patch4 -p1 -b .QTBUG-35459 %patch12 -p1 -b .enable_ft_lcdfilter -#patch50 -p1 -b .poll %patch51 -p1 -b .disconnect_displays +%patch52 -p1 -b .138201 + %if 0%{?rhel} == 6 %patch100 -p1 -b .QTBUG-43057 %endif # drop -fexceptions from $RPM_OPT_FLAGS RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's|-fexceptions||g'` -%ifarch %{ix86} -%if 0%{?fedora} > 22 -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's|-fasynchronous-unwind-tables||g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's|--param=ssp-buffer-size=4||g'` -%endif -%endif %define platform linux-g++ @@ -354,10 +356,7 @@ test -x configure || chmod +x configure -bindir %{_qt5_bindir} \ -datadir %{_qt5_datadir} \ -docdir %{_qt5_docdir} \ -%if 0%{?examples} -examplesdir %{_qt5_examplesdir} \ - -no-compile-examples \ -%endif -headerdir %{_qt5_headerdir} \ -importdir %{_qt5_importdir} \ -libdir %{_qt5_libdir} \ @@ -750,10 +749,8 @@ fi %{_qt5_libdir}/libQt5PlatformSupport.*a %{_qt5_libdir}/libQt5PlatformSupport.prl -%if 0%{?examples} %files examples %{_qt5_examplesdir}/ -%endif %if "%{?ibase}" != "-no-sql-ibase" %files ibase @@ -845,18 +842,40 @@ fi %changelog -* Fri Nov 13 2015 Helio Chissini de Castro - 5.6.0-0.2 +* Sat Dec 05 2015 Helio Chissini de Castro - 5.6.0-0.3 +- Beta 3 +- Reintroduce xcb patch from https://codereview.qt-project.org/#/c/138201/ + +* Fri Nov 27 2015 Helio Chissini de Castro - 5.6.0-0.2 - Valgrind still needed as buildreq due recent split qdoc package, but we can get rid of specific arch set. - Added missing libproxy buildreq - Epel and RHEL doesn't have libinput, so a plugin need to be excluded for this distros +* Wed Nov 25 2015 Rex Dieter 5.5.1-10 +- -devel: Requires: redhat-rpm-config (#1248174) + +* Wed Nov 18 2015 Helio Chissini de Castro - 5.5.1-9 +- Get rid of valgrind hack. It sort out that we don't need it anymore (#1211203) + +* Mon Nov 09 2015 Helio Chissini de Castro - 5.5.1-8 +- qt5-qdoc need requires >= current version, otherwise will prevent the usage further when moved to qttools + +* Mon Nov 09 2015 Rex Dieter 5.5.1-7 +- qt5-qdoc subpkg + * Tue Nov 03 2015 Helio Chissini de Castro - 5.6.0-0.1 - Start to implement 5.6.0 beta * Tue Nov 03 2015 Helio Chissini de Castro - 5.6.0-0.1 - Start to implement 5.6.0 beta +* Wed Oct 28 2015 David Tardon - 5.5.1-6 +- full build + +* Wed Oct 28 2015 David Tardon - 5.5.1-5 +- rebuild for ICU 56.1 + * Thu Oct 15 2015 Helio Chissini de Castro - 5.5.1-2 - Update to final release 5.5.1 diff --git a/qtbase-opensource-src-5.6.0-xcb-gerrit-138201.patch b/qtbase-opensource-src-5.6.0-xcb-gerrit-138201.patch new file mode 100644 index 0000000..52e4020 --- /dev/null +++ b/qtbase-opensource-src-5.6.0-xcb-gerrit-138201.patch @@ -0,0 +1,704 @@ +From 56657b57083caa77e368452b07224bb70082bbc6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= +Date: Fri, 16 Oct 2015 22:51:59 +0200 +Subject: [PATCH] xcb: QScreen is a placeholder whenever there are no outputs + connected + +If no screens are available, windows could disappear, could stop rendering +graphics, or the application could crash. This is a real use case in several +scenarios: with x11vnc, when all monitors are physically disconnected from a +desktop machine, or in some cases even when the monitor sleeps. Now when the +last screen is disconnected, it is transformed into a fake screen. When a +physical screen appears, the fake QScreen is transformed into a representation +of the physical screen. Every virtual desktop has its own fake screen, and +primary screens must belong to the primary virtual desktop. It fixes updating +screen geometry on temporarily disabled screens in the middle of the mode +switch. + +Expected results: Windows don't disappear, the application doesn't +crash, and QMenu is displayed on the appropriate screen. + +This reverts patch 51ada7734ad780178ecced11e0dff454dfc2e5f2 + +Change-Id: I6e8eb682b0c8425d08ffdaecbd4c6c7700c914b4 +Task-number: QTBUG-42985 +--- + src/gui/kernel/qscreen.cpp | 4 +- + src/plugins/platforms/xcb/qxcbconnection.cpp | 265 +++++++++++++++------------ + src/plugins/platforms/xcb/qxcbconnection.h | 10 +- + src/plugins/platforms/xcb/qxcbscreen.cpp | 49 +++-- + src/plugins/platforms/xcb/qxcbscreen.h | 10 +- + src/plugins/platforms/xcb/qxcbwindow.cpp | 38 +--- + src/plugins/platforms/xcb/qxcbwindow.h | 1 - + 7 files changed, 205 insertions(+), 172 deletions(-) + +diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp +index b6b5037..4338db2 100644 +--- a/src/gui/kernel/qscreen.cpp ++++ b/src/gui/kernel/qscreen.cpp +@@ -116,8 +116,8 @@ QScreen::~QScreen() + bool movingFromVirtualSibling = primaryScreen && primaryScreen->handle()->virtualSiblings().contains(handle()); + + // Move any leftover windows to the primary screen +- foreach (QWindow *window, QGuiApplication::topLevelWindows()) { +- if (window->screen() != this) ++ foreach (QWindow *window, QGuiApplication::allWindows()) { ++ if (!window->isTopLevel() || window->screen() != this) + continue; + + const bool wasVisible = window->isVisible(); +diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp +index 901764b..66a794a 100644 +--- a/src/plugins/platforms/xcb/qxcbconnection.cpp ++++ b/src/plugins/platforms/xcb/qxcbconnection.cpp +@@ -179,42 +179,6 @@ QXcbScreen* QXcbConnection::findScreenForOutput(xcb_window_t rootWindow, xcb_ran + return 0; + } + +-QXcbScreen* QXcbConnection::createScreen(QXcbVirtualDesktop* virtualDesktop, +- xcb_randr_output_t outputId, +- xcb_randr_get_output_info_reply_t *output) +-{ +- QString name; +- if (output) +- name = QString::fromUtf8((const char*)xcb_randr_get_output_info_name(output), +- xcb_randr_get_output_info_name_length(output)); +- else { +- QByteArray displayName = m_displayName; +- int dotPos = displayName.lastIndexOf('.'); +- if (dotPos != -1) +- displayName.truncate(dotPos); +- name = QString::fromLocal8Bit(displayName) + QLatin1Char('.') + QString::number(virtualDesktop->number()); +- } +- +- return new QXcbScreen(this, virtualDesktop, outputId, output, name); +-} +- +-bool QXcbConnection::checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output) +-{ +- xcb_generic_error_t *error = 0; +- xcb_randr_get_output_primary_cookie_t primaryCookie = +- xcb_randr_get_output_primary(xcb_connection(), rootWindow); +- QScopedPointer primary ( +- xcb_randr_get_output_primary_reply(xcb_connection(), primaryCookie, &error)); +- if (!primary || error) { +- qWarning("failed to get the primary output of the screen"); +- free(error); +- error = NULL; +- } +- const bool isPrimary = primary ? (primary->output == output) : false; +- +- return isPrimary; +-} +- + QXcbVirtualDesktop* QXcbConnection::virtualDesktopForRootWindow(xcb_window_t rootWindow) + { + foreach (QXcbVirtualDesktop *virtualDesktop, m_virtualDesktops) { +@@ -260,16 +224,7 @@ void QXcbConnection::updateScreens(const xcb_randr_notify_event_t *event) + + if (screen && output.connection == XCB_RANDR_CONNECTION_DISCONNECTED) { + qCDebug(lcQpaScreen) << "screen" << screen->name() << "has been disconnected"; +- +- // Known screen removed -> delete it +- m_screens.removeOne(screen); +- virtualDesktop->removeScreen(screen); +- +- QXcbIntegration::instance()->destroyScreen(screen); +- +- // QTBUG-40174, QTBUG-42985: If all screens are removed, wait +- // and start rendering again later if a screen becomes available. +- ++ destroyScreen(screen); + } else if (!screen && output.connection == XCB_RANDR_CONNECTION_CONNECTED) { + // New XRandR output is available and it's enabled + if (output.crtc != XCB_NONE && output.mode != XCB_NONE) { +@@ -278,59 +233,138 @@ void QXcbConnection::updateScreens(const xcb_randr_notify_event_t *event) + QScopedPointer outputInfo( + xcb_randr_get_output_info_reply(xcb_connection(), outputInfoCookie, NULL)); + +- screen = createScreen(virtualDesktop, output.output, outputInfo.data()); +- qCDebug(lcQpaScreen) << "output" << screen->name() << "is connected and enabled"; ++ // Find a fake screen ++ foreach (QPlatformScreen *screen, virtualDesktop->screens()) { ++ QXcbScreen *xcbScreen = (QXcbScreen *)screen; ++ if (xcbScreen->output() == XCB_NONE) { ++ screen = xcbScreen; ++ break; ++ } ++ } + +- screen->setPrimary(checkOutputIsPrimary(output.window, output.output)); +- virtualDesktop->addScreen(screen); +- m_screens << screen; +- QXcbIntegration::instance()->screenAdded(screen, screen->isPrimary()); +- +- // Windows which had null screens have already had expose events by now. +- // They need to be told the screen is back, it's OK to render. +- foreach (QWindow *window, QGuiApplication::topLevelWindows()) { +- QXcbWindow *xcbWin = static_cast(window->handle()); +- if (xcbWin) +- xcbWin->maybeSetScreen(screen); ++ if (screen) { ++ // Transform the fake screen into a physical screen ++ screen->setOutput(output.output, outputInfo.data()); ++ updateScreen(screen, output); ++ } else { ++ screen = createScreen(virtualDesktop, output, outputInfo.data()); + } ++ ++ qCDebug(lcQpaScreen) << "output" << screen->name() << "is connected and enabled"; + } +- // else ignore disabled screens + } else if (screen) { +- // Screen has been disabled -> remove + if (output.crtc == XCB_NONE && output.mode == XCB_NONE) { ++ // Screen has been disabled + 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); +- virtualDesktop->removeScreen(screen); +- QXcbIntegration::instance()->destroyScreen(screen); ++ destroyScreen(screen); + } else { + qCDebug(lcQpaScreen) << "output" << screen->name() << "has been temporarily disabled for the mode switch"; ++ // Reset crtc to skip RRCrtcChangeNotify events, ++ // because they may be invalid in the middle of the mode switch ++ screen->setCrtc(XCB_NONE); + } + } else { +- // Just update existing screen +- screen->updateGeometry(output.config_timestamp); +- const bool wasPrimary = screen->isPrimary(); +- screen->setPrimary(checkOutputIsPrimary(output.window, output.output)); +- if (screen->mode() != output.mode) +- screen->updateRefreshRate(output.mode); +- +- // If the screen became primary, reshuffle the order in QGuiApplicationPrivate +- if (!wasPrimary && screen->isPrimary()) { +- const int idx = m_screens.indexOf(screen); +- m_screens.swap(0, idx); +- QXcbIntegration::instance()->setPrimaryScreen(screen); +- } ++ updateScreen(screen, output); + qCDebug(lcQpaScreen) << "output has changed" << screen; + } + } ++ ++ qCDebug(lcQpaScreen) << "primary output is" << m_screens.first()->name(); ++ } ++} ++ ++bool QXcbConnection::checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output) ++{ ++ xcb_generic_error_t *error = 0; ++ xcb_randr_get_output_primary_cookie_t primaryCookie = ++ xcb_randr_get_output_primary(xcb_connection(), rootWindow); ++ QScopedPointer primary ( ++ xcb_randr_get_output_primary_reply(xcb_connection(), primaryCookie, &error)); ++ if (!primary || error) { ++ qWarning("failed to get the primary output of the screen"); ++ free(error); ++ error = NULL; ++ } ++ const bool isPrimary = primary ? (primary->output == output) : false; ++ ++ return isPrimary; ++} ++ ++void QXcbConnection::updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange) ++{ ++ screen->setCrtc(outputChange.crtc); // Set the new crtc, because it can be invalid ++ screen->updateGeometry(outputChange.config_timestamp); ++ if (screen->mode() != outputChange.mode) ++ screen->updateRefreshRate(outputChange.mode); ++ // Only screen which belongs to the primary virtual desktop can be a primary screen ++ if (screen->screenNumber() == m_primaryScreenNumber) { ++ if (!screen->isPrimary() && checkOutputIsPrimary(outputChange.window, outputChange.output)) { ++ screen->setPrimary(true); ++ ++ // If the screen became primary, reshuffle the order in QGuiApplicationPrivate ++ const int idx = m_screens.indexOf(screen); ++ if (idx > 0) { ++ m_screens.first()->setPrimary(false); ++ m_screens.swap(0, idx); ++ } ++ screen->virtualDesktop()->setPrimaryScreen(screen); ++ QXcbIntegration::instance()->setPrimaryScreen(screen); ++ } ++ } ++} ++ ++QXcbScreen *QXcbConnection::createScreen(QXcbVirtualDesktop *virtualDesktop, ++ const xcb_randr_output_change_t &outputChange, ++ xcb_randr_get_output_info_reply_t *outputInfo) ++{ ++ QXcbScreen *screen = new QXcbScreen(this, virtualDesktop, outputChange.output, outputInfo); ++ // Only screen which belongs to the primary virtual desktop can be a primary screen ++ if (screen->screenNumber() == m_primaryScreenNumber) ++ screen->setPrimary(checkOutputIsPrimary(outputChange.window, outputChange.output)); ++ ++ if (screen->isPrimary()) { + if (!m_screens.isEmpty()) +- qCDebug(lcQpaScreen) << "primary output is" << m_screens.first()->name(); +- else +- qCDebug(lcQpaScreen) << "no outputs"; ++ m_screens.first()->setPrimary(false); ++ ++ m_screens.prepend(screen); ++ } else { ++ m_screens.append(screen); ++ } ++ virtualDesktop->addScreen(screen); ++ QXcbIntegration::instance()->screenAdded(screen, screen->isPrimary()); ++ ++ return screen; ++} ++ ++void QXcbConnection::destroyScreen(QXcbScreen *screen) ++{ ++ QXcbVirtualDesktop *virtualDesktop = screen->virtualDesktop(); ++ if (virtualDesktop->screens().count() == 1) { ++ // If there are no other screens on the same virtual desktop, ++ // then transform the physical screen into a fake screen. ++ screen->setOutput(XCB_NONE, Q_NULLPTR); ++ } else { ++ // There is more than one screen on the same virtual desktop, remove the screen ++ m_screens.removeOne(screen); ++ virtualDesktop->removeScreen(screen); ++ ++ // When primary screen is removed, set the new primary screen ++ // which belongs to the primary virtual desktop. ++ if (screen->isPrimary()) { ++ QXcbScreen *newPrimary = (QXcbScreen *)virtualDesktop->screens().at(0); ++ newPrimary->setPrimary(true); ++ const int idx = m_screens.indexOf(newPrimary); ++ if (idx > 0) ++ m_screens.swap(0, idx); ++ QXcbIntegration::instance()->setPrimaryScreen(newPrimary); ++ } ++ ++ QXcbIntegration::instance()->destroyScreen(screen); + } + } + +@@ -338,8 +372,7 @@ void QXcbConnection::initializeScreens() + { + xcb_screen_iterator_t it = xcb_setup_roots_iterator(m_setup); + int xcbScreenNumber = 0; // screen number in the xcb sense +- QXcbScreen* primaryScreen = Q_NULLPTR; +- bool hasOutputs = false; ++ QXcbScreen *primaryScreen = Q_NULLPTR; + while (it.rem) { + // Each "screen" in xcb terminology is a virtual desktop, + // potentially a collection of separate juxtaposed monitors. +@@ -348,8 +381,6 @@ void QXcbConnection::initializeScreens() + xcb_screen_t *xcbScreen = it.data; + QXcbVirtualDesktop *virtualDesktop = new QXcbVirtualDesktop(this, xcbScreen, xcbScreenNumber); + m_virtualDesktops.append(virtualDesktop); +- QList siblings; +- int outputCount = 0; + if (has_randr_extension) { + xcb_generic_error_t *error = NULL; + // RRGetScreenResourcesCurrent is fast but it may return nothing if the +@@ -366,7 +397,7 @@ void QXcbConnection::initializeScreens() + } else { + xcb_timestamp_t timestamp; + xcb_randr_output_t *outputs = Q_NULLPTR; +- outputCount = xcb_randr_get_screen_resources_current_outputs_length(resources_current.data()); ++ int outputCount = xcb_randr_get_screen_resources_current_outputs_length(resources_current.data()); + if (outputCount) { + timestamp = resources_current->config_timestamp; + outputs = xcb_randr_get_screen_resources_current_outputs(resources_current.data()); +@@ -393,6 +424,7 @@ void QXcbConnection::initializeScreens() + qWarning("failed to get the primary output of the screen"); + free(error); + } else { ++ QList siblings; + for (int i = 0; i < outputCount; i++) { + QScopedPointer output( + xcb_randr_get_output_info_reply(xcb_connection(), +@@ -416,9 +448,8 @@ void QXcbConnection::initializeScreens() + continue; + } + +- QXcbScreen *screen = createScreen(virtualDesktop, outputs[i], output.data()); ++ QXcbScreen *screen = new QXcbScreen(this, virtualDesktop, outputs[i], output.data()); + siblings << screen; +- hasOutputs = true; + m_screens << screen; + + // There can be multiple outputs per screen, use either +@@ -435,11 +466,22 @@ void QXcbConnection::initializeScreens() + } + } + } ++ virtualDesktop->setScreens(siblings); + } + } + } + } +- virtualDesktop->setScreens(siblings); ++ if (virtualDesktop->screens().isEmpty()) { ++ // If there are no XRandR outputs or XRandR extension is missing, ++ // then create a fake/legacy screen. ++ QXcbScreen *screen = new QXcbScreen(this, virtualDesktop, XCB_NONE, Q_NULLPTR); ++ m_screens << screen; ++ if (m_primaryScreenNumber == xcbScreenNumber) { ++ primaryScreen = screen; ++ primaryScreen->setPrimary(true); ++ } ++ virtualDesktop->addScreen(screen); ++ } + xcb_screen_next(&it); + ++xcbScreenNumber; + } // for each xcb screen +@@ -447,39 +489,25 @@ void QXcbConnection::initializeScreens() + foreach (QXcbVirtualDesktop *virtualDesktop, m_virtualDesktops) + virtualDesktop->subscribeToXFixesSelectionNotify(); + +- // If there's no randr extension, or there was some error above, or we found a +- // screen which doesn't have outputs for some other reason (e.g. on VNC or ssh -X), +- // but the dimensions are known anyway, and we don't already have any lingering +- // (possibly disconnected) screens, then showing windows should be possible, +- // so create one screen. (QTBUG-31389) +- QXcbVirtualDesktop *virtualDesktop = m_virtualDesktops.value(0); +- if (virtualDesktop && !hasOutputs && !virtualDesktop->size().isEmpty() && m_screens.isEmpty()) { +- QXcbScreen *screen = createScreen(virtualDesktop, 0, Q_NULLPTR); +- virtualDesktop->setScreens(QList() << screen); +- m_screens << screen; +- primaryScreen = screen; +- primaryScreen->setPrimary(true); +- qCDebug(lcQpaScreen) << "found a screen with zero outputs" << screen; +- } +- +- // Ensure the primary screen is first in the list +- if (primaryScreen) { +- Q_ASSERT(!m_screens.isEmpty()); +- if (m_screens.first() != primaryScreen) { +- m_screens.removeOne(primaryScreen); +- m_screens.prepend(primaryScreen); ++ if (m_virtualDesktops.isEmpty()) { ++ qFatal("QXcbConnection: no screens available"); ++ } else { ++ // Ensure the primary screen is first on the list ++ if (primaryScreen) { ++ if (m_screens.first() != primaryScreen) { ++ m_screens.removeOne(primaryScreen); ++ m_screens.prepend(primaryScreen); ++ } + } +- } + +- // Push the screens to QApplication +- QXcbIntegration *integration = QXcbIntegration::instance(); +- foreach (QXcbScreen* screen, m_screens) { +- qCDebug(lcQpaScreen) << "adding" << screen << "(Primary:" << screen->isPrimary() << ')'; +- integration->screenAdded(screen, screen->isPrimary()); +- } ++ // Push the screens to QGuiApplication ++ foreach (QXcbScreen *screen, m_screens) { ++ qCDebug(lcQpaScreen) << "adding" << screen << "(Primary:" << screen->isPrimary() << ")"; ++ QXcbIntegration::instance()->screenAdded(screen, screen->isPrimary()); ++ } + +- if (!m_screens.isEmpty()) + qCDebug(lcQpaScreen) << "primary output is" << m_screens.first()->name(); ++ } + } + + QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName) +@@ -553,9 +581,6 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra + initializeXFixes(); + initializeScreens(); + +- if (m_screens.isEmpty()) +- qFatal("QXcbConnection: no screens available"); +- + initializeXRender(); + m_xi2Enabled = false; + #if defined(XCB_USE_XINPUT2) +diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h +index 3c82170..fb7cc13 100644 +--- a/src/plugins/platforms/xcb/qxcbconnection.h ++++ b/src/plugins/platforms/xcb/qxcbconnection.h +@@ -518,15 +518,17 @@ private: + void initializeXShape(); + void initializeXKB(); + void handleClientMessageEvent(const xcb_client_message_event_t *event); +- QXcbScreen* createScreen(QXcbVirtualDesktop *virtualDesktop, +- xcb_randr_output_t outputId = XCB_NONE, +- xcb_randr_get_output_info_reply_t *output = 0); + QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc); + QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output); + QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow); ++ void updateScreens(const xcb_randr_notify_event_t *event); + bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); ++ void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); ++ QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, ++ const xcb_randr_output_change_t &outputChange, ++ xcb_randr_get_output_info_reply_t *outputInfo); ++ void destroyScreen(QXcbScreen *screen); + void initializeScreens(); +- void updateScreens(const xcb_randr_notify_event_t *event); + bool compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const; + + bool m_xi2Enabled; +diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp +index 2a53b18..bf3c0a6 100644 +--- a/src/plugins/platforms/xcb/qxcbscreen.cpp ++++ b/src/plugins/platforms/xcb/qxcbscreen.cpp +@@ -81,6 +81,13 @@ void QXcbVirtualDesktop::addScreen(QPlatformScreen *s) + ((QXcbScreen *) s)->isPrimary() ? m_screens.prepend(s) : m_screens.append(s); + } + ++void QXcbVirtualDesktop::setPrimaryScreen(QPlatformScreen *s) ++{ ++ const int idx = m_screens.indexOf(s); ++ Q_ASSERT(idx > -1); ++ m_screens.swap(0, idx); ++} ++ + QXcbXSettings *QXcbVirtualDesktop::xSettings() const + { + if (!m_xSettings) { +@@ -149,16 +156,15 @@ void QXcbVirtualDesktop::updateWorkArea() + } + + QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, +- xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *output, +- QString outputName) ++ xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *output) + : QXcbObject(connection) + , m_virtualDesktop(virtualDesktop) + , m_output(outputId) +- , m_crtc(output ? output->crtc : 0) ++ , m_crtc(output ? output->crtc : XCB_NONE) + , m_mode(XCB_NONE) + , m_primary(false) + , m_rotation(XCB_RANDR_ROTATION_ROTATE_0) +- , m_outputName(outputName) ++ , m_outputName(getOutputName(output)) + , m_outputSizeMillimeters(output ? QSize(output->mm_width, output->mm_height) : QSize()) + , m_virtualSize(virtualDesktop->size()) + , m_virtualSizeMillimeters(virtualDesktop->physicalSize()) +@@ -268,6 +274,22 @@ QXcbScreen::~QXcbScreen() + delete m_cursor; + } + ++QString QXcbScreen::getOutputName(xcb_randr_get_output_info_reply_t *outputInfo) ++{ ++ QString name; ++ if (outputInfo) { ++ name = QString::fromUtf8((const char*)xcb_randr_get_output_info_name(outputInfo), ++ xcb_randr_get_output_info_name_length(outputInfo)); ++ } else { ++ QByteArray displayName = connection()->displayName(); ++ int dotPos = displayName.lastIndexOf('.'); ++ if (dotPos != -1) ++ displayName.truncate(dotPos); ++ name = QString::fromLocal8Bit(displayName) + QLatin1Char('.') ++ + QString::number(m_virtualDesktop->number()); ++ } ++ return name; ++} + + QWindow *QXcbScreen::topLevelAt(const QPoint &p) const + { +@@ -392,6 +414,16 @@ QPlatformCursor *QXcbScreen::cursor() const + return m_cursor; + } + ++void QXcbScreen::setOutput(xcb_randr_output_t outputId, ++ xcb_randr_get_output_info_reply_t *outputInfo) ++{ ++ m_output = outputId; ++ m_crtc = outputInfo ? outputInfo->crtc : XCB_NONE; ++ m_mode = XCB_NONE; ++ m_outputName = getOutputName(outputInfo); ++ // TODO: Send an event to the QScreen instance that the screen changed its name ++} ++ + /*! + \brief handle the XCB screen change event and update properties + +@@ -460,19 +492,10 @@ void QXcbScreen::handleScreenChange(xcb_randr_screen_change_notify_event_t *chan + + updateGeometry(change_event->timestamp); + +- QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), geometry(), availableGeometry()); + QWindowSystemInterface::handleScreenOrientationChange(QPlatformScreen::screen(), m_orientation); + + QDpi ldpi = logicalDpi(); + QWindowSystemInterface::handleScreenLogicalDotsPerInchChange(QPlatformScreen::screen(), ldpi.first, ldpi.second); +- +- // Windows which had null screens have already had expose events by now. +- // They need to be told the screen is back, it's OK to render. +- foreach (QWindow *window, QGuiApplication::topLevelWindows()) { +- QXcbWindow *xcbWin = static_cast(window->handle()); +- if (xcbWin) +- xcbWin->maybeSetScreen(this); +- } + } + + void QXcbScreen::updateGeometry(xcb_timestamp_t timestamp) +diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h +index c68c290..79620f4 100644 +--- a/src/plugins/platforms/xcb/qxcbscreen.h ++++ b/src/plugins/platforms/xcb/qxcbscreen.h +@@ -72,6 +72,7 @@ public: + void setScreens(QList sl) { m_screens = sl; } + void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } + void addScreen(QPlatformScreen *s); ++ void setPrimaryScreen(QPlatformScreen *s); + + QXcbXSettings *xSettings() const; + +@@ -101,10 +102,11 @@ class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen + { + public: + QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, +- xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *output, +- QString outputName); ++ xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); + ~QXcbScreen(); + ++ QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); ++ + QPixmap grabWindow(WId window, int x, int y, int width, int height) const Q_DECL_OVERRIDE; + + QWindow *topLevelAt(const QPoint &point) const Q_DECL_OVERRIDE; +@@ -137,6 +139,10 @@ public: + xcb_randr_crtc_t crtc() const { return m_crtc; } + xcb_randr_mode_t mode() const { return m_mode; } + ++ void setOutput(xcb_randr_output_t outputId, ++ xcb_randr_get_output_info_reply_t *outputInfo); ++ void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } ++ + void windowShown(QXcbWindow *window); + QString windowManagerName() const { return m_windowManagerName; } + bool syncRequestSupported() const { return m_syncRequestSupported; } +diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp +index d0efb68..cbb67f0 100644 +--- a/src/plugins/platforms/xcb/qxcbwindow.cpp ++++ b/src/plugins/platforms/xcb/qxcbwindow.cpp +@@ -627,14 +627,6 @@ void QXcbWindow::destroy() + m_pendingSyncRequest->invalidate(); + } + +-void QXcbWindow::maybeSetScreen(QXcbScreen *screen) +-{ +- if (!window()->screen() && screen->geometry().contains(geometry().topLeft())) { +- QWindowSystemInterface::handleWindowScreenChanged(window(), static_cast(screen)->screen()); +- QWindowSystemInterface::handleExposeEvent(window(), QRegion(QRect(QPoint(0, 0), window()->size()))); +- } +-} +- + void QXcbWindow::setGeometry(const QRect &rect) + { + QPlatformWindow::setGeometry(rect); +@@ -850,15 +842,13 @@ void QXcbWindow::hide() + Q_XCB_CALL(xcb_unmap_window(xcb_connection(), m_window)); + + // send synthetic UnmapNotify event according to icccm 4.1.4 +- if (xcbScreen()) { +- xcb_unmap_notify_event_t event; +- event.response_type = XCB_UNMAP_NOTIFY; +- event.event = xcbScreen()->root(); +- event.window = m_window; +- event.from_configure = false; +- Q_XCB_CALL(xcb_send_event(xcb_connection(), false, xcbScreen()->root(), +- XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *)&event)); +- } ++ xcb_unmap_notify_event_t event; ++ event.response_type = XCB_UNMAP_NOTIFY; ++ event.event = xcbScreen()->root(); ++ event.window = m_window; ++ event.from_configure = false; ++ Q_XCB_CALL(xcb_send_event(xcb_connection(), false, xcbScreen()->root(), ++ XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *)&event)); + + xcb_flush(xcb_connection()); + +@@ -1186,8 +1176,6 @@ void QXcbWindow::changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two) + event.data.data32[3] = 0; + event.data.data32[4] = 0; + +- if (!xcbScreen()) +- return; + Q_XCB_CALL(xcb_send_event(xcb_connection(), 0, xcbScreen()->root(), XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *)&event)); + } + +@@ -1440,8 +1428,6 @@ void QXcbWindow::setParent(const QPlatformWindow *parent) + xcb_parent_id = qXcbParent->xcb_window(); + m_embedded = qXcbParent->window()->type() == Qt::ForeignWindow; + } else { +- if (!xcbScreen()) +- return; + xcb_parent_id = xcbScreen()->root(); + m_embedded = false; + } +@@ -1997,7 +1983,7 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t * + { + bool fromSendEvent = (event->response_type & 0x80); + QPoint pos(event->x, event->y); +- if (!parent() && !fromSendEvent && xcbScreen()) { ++ if (!parent() && !fromSendEvent) { + // Do not trust the position, query it instead. + xcb_translate_coordinates_cookie_t cookie = xcb_translate_coordinates(xcb_connection(), xcb_window(), + xcbScreen()->root(), 0, 0); +@@ -2297,8 +2283,6 @@ void QXcbWindow::handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) + return; + + const QPoint local(event->event_x, event->event_y); +- if (!xcbScreen()) +- return; + QPoint global = QPoint(event->root_x, event->root_y); + QWindowSystemInterface::handleEnterEvent(window(), local, global); + } +@@ -2316,8 +2300,6 @@ void QXcbWindow::handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) + + if (enterWindow) { + QPoint local(enter->event_x, enter->event_y); +- if (!xcbScreen()) +- return; + QPoint global = QPoint(event->root_x, event->root_y); + + QWindowSystemInterface::handleEnterLeaveEvent(enterWindow->window(), window(), local, global); +@@ -2333,8 +2315,6 @@ void QXcbWindow::handlePropertyNotifyEvent(const xcb_property_notify_event_t *ev + connection()->setTime(event->time); + + const bool propertyDeleted = event->state == XCB_PROPERTY_DELETE; +- if (!xcbScreen()) +- return; + + if (event->atom == atom(QXcbAtom::_NET_WM_STATE) || event->atom == atom(QXcbAtom::WM_STATE)) { + if (propertyDeleted) +@@ -2654,8 +2634,6 @@ bool QXcbWindow::needsSync() const + + void QXcbWindow::postSyncWindowRequest() + { +- if (!xcbScreen()) +- return; + if (!m_pendingSyncRequest) { + QXcbSyncWindowRequest *e = new QXcbSyncWindowRequest(this); + m_pendingSyncRequest = e; +diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h +index fd7d69c..4d7ea96 100644 +--- a/src/plugins/platforms/xcb/qxcbwindow.h ++++ b/src/plugins/platforms/xcb/qxcbwindow.h +@@ -167,7 +167,6 @@ public: + + virtual void create(); + virtual void destroy(); +- void maybeSetScreen(QXcbScreen *screen); + QXcbScreen *screenForNativeGeometry(const QRect &newGeometry) const; + + public Q_SLOTS: +-- +2.5.0 + diff --git a/sources b/sources index 8f2e9a4..06e6cad 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -687e2b122fa2c3390b5e20a166d38038 qtbase-opensource-src-5.5.1.tar.xz +42be7547996328b76998f89047f92c32 qtbase-opensource-src-5.6.0-beta2.tar.xz From 59c34629a72e2a53b80fbe68209a40286aae026b Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Sun, 6 Dec 2015 12:22:56 -0600 Subject: [PATCH 09/62] 5.6.0-0.4 - re-introduce bootstrap/examples macros - put examples-manifest.xml in -examples - restore -doc multilib hack (to be on the safe side, can't hurt) - %build: s/-optimized-qmake/-optimized-tools/ --- qt5-qtbase.spec | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index d905400..76d9929 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -15,19 +15,31 @@ %global rpm_macros_dir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) +## set to 1 to enable bootstrap +#global bootstrap 1 + %if 0%{?fedora} > 21 # use external qt_settings pkg %global qt_settings 1 %endif +# define to build docs, need to undef this for bootstrapping +# where qt5-qttools builds are not yet available +# only primary archs (for now), allow secondary to bootstrap +%if ! 0%{?bootstrap} +%ifarch %{arm} %{ix86} x86_64 %define docs 1 +%endif +%endif + +%define examples 1 %define prerelease beta2 Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.3%{?dist} +Release: 0.4%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -344,7 +356,6 @@ popd # check to ensure that can't happen -- rex test -x configure || chmod +x configure -# %build # limit -reduce-relocations to %%ix86 x86_64 archs, https://bugreports.qt-project.org/browse/QTBUG-36129 @@ -376,7 +387,8 @@ test -x configure || chmod +x configure -iconv \ -icu \ -openssl-linked \ - -optimized-qmake \ + -optimized-tools \ + %{!?examples:-nomake examples} \ -nomake tests \ -no-pch \ -no-rpath \ @@ -402,6 +414,10 @@ test -x configure || chmod +x configure make %{?_smp_mflags} %if 0%{?docs} +# HACK to avoid multilib conflicts in noarch content +# see also https://bugreports.qt-project.org/browse/QTBUG-42071 +QT_HASH_SEED=0; export QT_HASH_SEED + make html_docs make qch_docs %endif @@ -625,6 +641,10 @@ fi %license LICENSE.FDL %doc dist/README dist/changes-5.* %{_qt5_docdir}/*.qch +%if 0%{?examples} +# included in -examples instead, see bug #1212750 +%exclude %{_qt5_docdir}/*/examples-manifest.xml +%endif %{_qt5_docdir}/qmake/ %{_qt5_docdir}/qtconcurrent/ %{_qt5_docdir}/qtcore/ @@ -749,8 +769,11 @@ fi %{_qt5_libdir}/libQt5PlatformSupport.*a %{_qt5_libdir}/libQt5PlatformSupport.prl +%if 0%{?examples} %files examples +%{_qt5_docdir}/*/examples-manifest.xml %{_qt5_examplesdir}/ +%endif %if "%{?ibase}" != "-no-sql-ibase" %files ibase @@ -842,6 +865,12 @@ fi %changelog +* Sun Dec 06 2015 Rex Dieter - 5.6.0-0.4 +- re-introduce bootstrap/examples macros +- put examples-manifest.xml in -examples +- restore -doc multilib hack (to be on the safe side, can't hurt) +- %%build: s/-optimized-qmake/-optimized-tools/ + * Sat Dec 05 2015 Helio Chissini de Castro - 5.6.0-0.3 - Beta 3 - Reintroduce xcb patch from https://codereview.qt-project.org/#/c/138201/ From 79a83406d24af301bde410c6ee1908df6156bb96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Vr=C3=A1til?= Date: Wed, 9 Dec 2015 15:27:48 +0100 Subject: [PATCH 10/62] Try reverting from -optimized-tools to -optimized-qmake --- qt5-qtbase.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 76d9929..bc1df63 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -39,7 +39,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.4%{?dist} +Release: 0.5%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -387,7 +387,7 @@ test -x configure || chmod +x configure -iconv \ -icu \ -openssl-linked \ - -optimized-tools \ + -optimized-qmake \ %{!?examples:-nomake examples} \ -nomake tests \ -no-pch \ @@ -865,6 +865,9 @@ fi %changelog +* Wed Dec 09 2015 Daniel Vratil - 5.6.0-0.5 +- try reverting from -optimized-tools to -optimized-qmake + * Sun Dec 06 2015 Rex Dieter - 5.6.0-0.4 - re-introduce bootstrap/examples macros - put examples-manifest.xml in -examples From 67c36efdbb17d3ddc80a95577ac4caacf2fc6fae Mon Sep 17 00:00:00 2001 From: Helio Chissini de Castro Date: Thu, 10 Dec 2015 21:38:36 +0100 Subject: [PATCH 11/62] - Update to final official beta --- .gitignore | 1 + qt5-qtbase.spec | 12 +++++++++--- sources | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 6ba87aa..6202538 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /qtbase-opensource-src-5.5.1.tar.xz /qtbase-opensource-src-5.6.0-beta2.tar.xz +/qtbase-opensource-src-5.6.0-beta.tar.gz diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index bc1df63..2a1bbe4 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -34,17 +34,17 @@ %define examples 1 -%define prerelease beta2 +%define prerelease beta Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.5%{?dist} +Release: 0.7%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions Url: http://qt-project.org/ -Source0: http://download.qt.io/official_releases/qt/5.6/%{version}%{?prerelease:-%{prerelease}}/submodules/%{qt_module}-opensource-src-%{version}%{?prerelease:-%{prerelease}}.tar.xz +Source0: http://download.qt.io/official_releases/qt/5.6/%{version}%{?prerelease:-%{prerelease}}/submodules/%{qt_module}-opensource-src-%{version}%{?prerelease:-%{prerelease}}.tar.gz # header file to workaround multilib issue # https://bugzilla.redhat.com/show_bug.cgi?id=1036956 @@ -865,6 +865,12 @@ fi %changelog +* Thu Dec 10 2015 Helio Chissini de Castro - 5.6.0-0.7 +- Official beta release + +* Thu Dec 10 2015 Helio Chissini de Castro - 5.6.0-0.6 +- Official beta release + * Wed Dec 09 2015 Daniel Vratil - 5.6.0-0.5 - try reverting from -optimized-tools to -optimized-qmake diff --git a/sources b/sources index 06e6cad..ecbcf83 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -42be7547996328b76998f89047f92c32 qtbase-opensource-src-5.6.0-beta2.tar.xz +53ce29b757fec734085627cdf25f176f qtbase-opensource-src-5.6.0-beta.tar.gz From c6386a503c3f5a9d95102c2fc9ab6faf468e7d37 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Fri, 11 Dec 2015 22:39:20 -0600 Subject: [PATCH 12/62] unused patches --- ...ling-of-outputs-in-the-middle-of-the.patch | 56 --- 138201.patch | 386 ------------------ 2 files changed, 442 deletions(-) delete mode 100644 0197-xcb-Ignore-disabling-of-outputs-in-the-middle-of-the.patch delete mode 100644 138201.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 deleted file mode 100644 index 364426e..0000000 --- a/0197-xcb-Ignore-disabling-of-outputs-in-the-middle-of-the.patch +++ /dev/null @@ -1,56 +0,0 @@ -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/138201.patch b/138201.patch deleted file mode 100644 index 4033b91..0000000 --- a/138201.patch +++ /dev/null @@ -1,386 +0,0 @@ -diff -rupN qtbase-opensource-src-5.5.1/src/plugins/platforms/xcb/qxcbconnection.cpp qtbase-opensource-src-5.5.1-new/src/plugins/platforms/xcb/qxcbconnection.cpp ---- qtbase-opensource-src-5.5.1/src/plugins/platforms/xcb/qxcbconnection.cpp 2015-10-13 06:35:27.000000000 +0200 -+++ qtbase-opensource-src-5.5.1-new/src/plugins/platforms/xcb/qxcbconnection.cpp 2015-10-21 21:02:53.056198256 +0200 -@@ -229,7 +229,6 @@ void QXcbConnection::updateScreens(const - if (screen->mode() != crtc.mode) - screen->updateRefreshRate(crtc.mode); - } -- - } else if (event->subCode == XCB_RANDR_NOTIFY_OUTPUT_CHANGE) { - xcb_randr_output_change_t output = event->u.oc; - QXcbVirtualDesktop *virtualDesktop = virtualDesktopForRootWindow(output.window); -@@ -242,20 +241,18 @@ void QXcbConnection::updateScreens(const - - if (screen && output.connection == XCB_RANDR_CONNECTION_DISCONNECTED) { - qCDebug(lcQpaScreen) << "screen" << screen->name() << "has been disconnected"; -- -- // Known screen removed -> delete it -- m_screens.removeOne(screen); -- foreach (QXcbScreen *otherScreen, m_screens) -- otherScreen->removeVirtualSibling((QPlatformScreen *) screen); -- -- QXcbIntegration::instance()->destroyScreen(screen); -- -- // QTBUG-40174, QTBUG-42985: If all screens are removed, wait -- // and start rendering again later if a screen becomes available. -- -+ destroyScreen(screen, true); - } else if (!screen && output.connection == XCB_RANDR_CONNECTION_CONNECTED) { - // New XRandR output is available and it's enabled - if (output.crtc != XCB_NONE && output.mode != XCB_NONE) { -+ // QTBUG-40174, QTBUG-42985: If virtual screen exists, -+ // remove it and next add a physical screen. -+ if (m_onlyVirtualScreen) { -+ qCDebug(lcQpaScreen) << "default screen" << screen->name() << "has been removed"; -+ destroyScreen(m_screens.at(0), false); -+ m_onlyVirtualScreen = false; -+ } -+ - xcb_randr_get_output_info_cookie_t outputInfoCookie = - xcb_randr_get_output_info(xcb_connection(), output.output, output.config_timestamp); - QScopedPointer outputInfo( -@@ -270,34 +267,25 @@ void QXcbConnection::updateScreens(const - otherScreen->addVirtualSibling(screen); - m_screens << screen; - QXcbIntegration::instance()->screenAdded(screen, screen->isPrimary()); -- -- // Windows which had null screens have already had expose events by now. -- // They need to be told the screen is back, it's OK to render. -- foreach (QWindow *window, QGuiApplication::topLevelWindows()) { -- QXcbWindow *xcbWin = static_cast(window->handle()); -- if (xcbWin) -- xcbWin->maybeSetScreen(screen); -- } -+ maybeSetScreenForTopLevelWindows(screen); - } -- // else ignore disabled screens - } else if (screen) { -- // Screen has been disabled -> remove - if (output.crtc == XCB_NONE && output.mode == XCB_NONE) { -+ // Screen has been disabled - 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); -+ destroyScreen(screen, true); - } else { - qCDebug(lcQpaScreen) << "output" << screen->name() << "has been temporarily disabled for the mode switch"; -+ screen->setCrtc(XCB_NONE); //Invalidate crtc - } - } else { - // Just update existing screen -+ screen->setCrtc(output.crtc); //Set the new crtc, because it may be invalidated - screen->updateGeometry(output.config_timestamp); - const bool wasPrimary = screen->isPrimary(); - screen->setPrimary(checkOutputIsPrimary(output.window, output.output)); -@@ -316,19 +304,61 @@ void QXcbConnection::updateScreens(const - qCDebug(lcQpaScreen) << "output has changed" << screen; - } - } -+ - if (!m_screens.isEmpty()) - qCDebug(lcQpaScreen) << "primary output is" << m_screens.first()->name(); - else - qCDebug(lcQpaScreen) << "no outputs"; - } - } -+void QXcbConnection::destroyScreen(QXcbScreen *screen, bool canCreateVirtualScreen) -+{ -+ // Known screen removed -> delete it -+ m_screens.removeOne(screen); -+ foreach (QXcbScreen *otherScreen, m_screens) -+ otherScreen->removeVirtualSibling((QPlatformScreen *)screen); -+ QXcbIntegration::instance()->destroyScreen(screen); -+ -+ // QTBUG-40174, QTBUG-42985: If all screens are removed, add a virtual -+ // screen and remove it later if a physical screen becomes available. -+ if (canCreateVirtualScreen && m_screens.isEmpty()) -+ createVirtualScreen(); -+} -+void QXcbConnection::createVirtualScreen() -+{ -+ QXcbVirtualDesktop *virtualDesktop = m_virtualDesktops.value(0); -+ if (virtualDesktop && !virtualDesktop->size().isEmpty()) { -+ Q_ASSERT(m_screens.isEmpty()); -+ QXcbScreen *screen = createScreen(virtualDesktop, 0, Q_NULLPTR); -+ screen->setVirtualSiblings(QList() << screen); -+ screen->setPrimary(true); -+ m_onlyVirtualScreen = true; -+ m_screens << screen; -+ QXcbIntegration::instance()->screenAdded(screen, screen->isPrimary()); -+ maybeSetScreenForTopLevelWindows(screen); -+ qCDebug(lcQpaScreen) << "virtual screen was created" << screen; -+ } -+} -+void QXcbConnection::maybeSetScreenForTopLevelWindows(QXcbScreen *screen) -+{ -+ // Windows which had null screens have already had expose events by now. -+ // They need to be told the screen is back, it's OK to render. -+ bool doFlush = false; -+ foreach (QWindow *window, QGuiApplication::topLevelWindows()) { -+ QXcbWindow *xcbWin = static_cast(window->handle()); -+ if (xcbWin) -+ doFlush |= xcbWin->maybeSetScreen(screen); -+ } -+ // Flush Window System Events to prevent disappearing windows -+ if (doFlush) -+ QWindowSystemInterface::flushWindowSystemEvents(); -+} - - void QXcbConnection::initializeScreens() - { - xcb_screen_iterator_t it = xcb_setup_roots_iterator(m_setup); - int xcbScreenNumber = 0; // screen number in the xcb sense - QXcbScreen* primaryScreen = Q_NULLPTR; -- bool hasOutputs = false; - while (it.rem) { - // Each "screen" in xcb terminology is a virtual desktop, - // potentially a collection of separate juxtaposed monitors. -@@ -407,7 +437,6 @@ void QXcbConnection::initializeScreens() - - QXcbScreen *screen = createScreen(virtualDesktop, outputs[i], output.data()); - siblings << screen; -- hasOutputs = true; - m_screens << screen; - - // There can be multiple outputs per screen, use either -@@ -434,39 +463,23 @@ void QXcbConnection::initializeScreens() - ++xcbScreenNumber; - } // for each xcb screen - -- // If there's no randr extension, or there was some error above, or we found a -- // screen which doesn't have outputs for some other reason (e.g. on VNC or ssh -X), -- // but the dimensions are known anyway, and we don't already have any lingering -- // (possibly disconnected) screens, then showing windows should be possible, -- // so create one screen. (QTBUG-31389) -- QXcbVirtualDesktop *virtualDesktop = m_virtualDesktops.value(0); -- if (virtualDesktop && !hasOutputs && !virtualDesktop->size().isEmpty() && m_screens.isEmpty()) { -- QXcbScreen *screen = createScreen(virtualDesktop, 0, Q_NULLPTR); -- screen->setVirtualSiblings(QList() << screen); -- m_screens << screen; -- primaryScreen = screen; -- primaryScreen->setPrimary(true); -- qCDebug(lcQpaScreen) << "found a screen with zero outputs" << screen; -- } -- -- // Ensure the primary screen is first in the list -- if (primaryScreen) { -- Q_ASSERT(!m_screens.isEmpty()); -- if (m_screens.first() != primaryScreen) { -- m_screens.removeOne(primaryScreen); -- m_screens.prepend(primaryScreen); -+ if (m_screens.isEmpty()) { -+ createVirtualScreen(); -+ } else { -+ // Ensure the primary screen is first in the list -+ if (primaryScreen) { -+ if (m_screens.first() != primaryScreen) { -+ m_screens.removeOne(primaryScreen); -+ m_screens.prepend(primaryScreen); -+ } - } -- } - -- // Push the screens to QApplication -- QXcbIntegration *integration = QXcbIntegration::instance(); -- foreach (QXcbScreen* screen, m_screens) { -- qCDebug(lcQpaScreen) << "adding" << screen << "(Primary:" << screen->isPrimary() << ")"; -- integration->screenAdded(screen, screen->isPrimary()); -- } -- -- if (!m_screens.isEmpty()) -- qCDebug(lcQpaScreen) << "primary output is" << m_screens.first()->name(); -+ // Push the screens to QGuiApplication -+ foreach (QXcbScreen *screen, m_screens) { -+ qCDebug(lcQpaScreen) << "adding" << screen << "(Primary:" << screen->isPrimary() << ")"; -+ QXcbIntegration::instance()->screenAdded(screen, screen->isPrimary()); -+ } -+ } - } - - QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName) -@@ -474,6 +487,7 @@ QXcbConnection::QXcbConnection(QXcbNativ - , m_canGrabServer(canGrabServer) - , m_defaultVisualId(defaultVisualId) - , m_primaryScreenNumber(0) -+ , m_onlyVirtualScreen(false) - , m_displayName(displayName ? QByteArray(displayName) : qgetenv("DISPLAY")) - , m_nativeInterface(nativeInterface) - #ifdef XCB_USE_XLIB -@@ -1110,8 +1124,19 @@ void QXcbConnection::handleXcbEvent(xcb_ - handled = false; - break; - case XCB_PROPERTY_NOTIFY: -- HANDLE_PLATFORM_WINDOW_EVENT(xcb_property_notify_event_t, window, handlePropertyNotifyEvent); -+ { -+ // Update geometry for all screens, because availableGeometry must be changed -+ const xcb_property_notify_event_t *propertyNotifyEvent = (const xcb_property_notify_event_t *)event; -+ if (propertyNotifyEvent->atom == atom(QXcbAtom::_NET_WORKAREA)) { -+ foreach (QXcbScreen *screen, m_screens) { -+ if (propertyNotifyEvent->window == screen->root()) -+ screen->updateGeometry(propertyNotifyEvent->time); -+ } -+ } else { -+ HANDLE_PLATFORM_WINDOW_EVENT(xcb_property_notify_event_t, window, handlePropertyNotifyEvent); -+ } - break; -+ } - #if defined(XCB_USE_XINPUT2) - case XCB_GE_GENERIC: - // Here the windowEventListener is invoked from xi2HandleEvent() -diff -rupN qtbase-opensource-src-5.5.1/src/plugins/platforms/xcb/qxcbconnection.h qtbase-opensource-src-5.5.1-new/src/plugins/platforms/xcb/qxcbconnection.h ---- qtbase-opensource-src-5.5.1/src/plugins/platforms/xcb/qxcbconnection.h 2015-10-13 06:35:27.000000000 +0200 -+++ qtbase-opensource-src-5.5.1-new/src/plugins/platforms/xcb/qxcbconnection.h 2015-10-21 21:00:21.767613360 +0200 -@@ -519,6 +519,9 @@ private: - QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow); - bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); - void initializeScreens(); -+ void destroyScreen(QXcbScreen *screen, bool canCreateVirtualScreen); -+ void createVirtualScreen(); -+ void maybeSetScreenForTopLevelWindows(QXcbScreen *screen); - void updateScreens(const xcb_randr_notify_event_t *event); - - bool m_xi2Enabled; -@@ -583,6 +586,7 @@ private: - QList m_virtualDesktops; - QList m_screens; - int m_primaryScreenNumber; -+ bool m_onlyVirtualScreen; - - xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; - -diff -rupN qtbase-opensource-src-5.5.1/src/plugins/platforms/xcb/qxcbscreen.cpp qtbase-opensource-src-5.5.1-new/src/plugins/platforms/xcb/qxcbscreen.cpp ---- qtbase-opensource-src-5.5.1/src/plugins/platforms/xcb/qxcbscreen.cpp 2015-10-13 06:35:27.000000000 +0200 -+++ qtbase-opensource-src-5.5.1-new/src/plugins/platforms/xcb/qxcbscreen.cpp 2015-10-21 21:00:21.768613377 +0200 -@@ -438,14 +438,6 @@ void QXcbScreen::handleScreenChange(xcb_ - - QDpi ldpi = logicalDpi(); - QWindowSystemInterface::handleScreenLogicalDotsPerInchChange(QPlatformScreen::screen(), ldpi.first, ldpi.second); -- -- // Windows which had null screens have already had expose events by now. -- // They need to be told the screen is back, it's OK to render. -- foreach (QWindow *window, QGuiApplication::topLevelWindows()) { -- QXcbWindow *xcbWin = static_cast(window->handle()); -- if (xcbWin) -- xcbWin->maybeSetScreen(this); -- } - } - - void QXcbScreen::updateGeometry(xcb_timestamp_t timestamp) -diff -rupN qtbase-opensource-src-5.5.1/src/plugins/platforms/xcb/qxcbscreen.h qtbase-opensource-src-5.5.1-new/src/plugins/platforms/xcb/qxcbscreen.h ---- qtbase-opensource-src-5.5.1/src/plugins/platforms/xcb/qxcbscreen.h 2015-10-13 06:35:27.000000000 +0200 -+++ qtbase-opensource-src-5.5.1-new/src/plugins/platforms/xcb/qxcbscreen.h 2015-10-21 21:00:21.768613377 +0200 -@@ -116,6 +116,8 @@ public: - xcb_randr_crtc_t crtc() const { return m_crtc; } - xcb_randr_mode_t mode() const { return m_mode; } - -+ void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } -+ - void windowShown(QXcbWindow *window); - QString windowManagerName() const { return m_windowManagerName; } - bool syncRequestSupported() const { return m_syncRequestSupported; } -diff -rupN qtbase-opensource-src-5.5.1/src/plugins/platforms/xcb/qxcbwindow.cpp qtbase-opensource-src-5.5.1-new/src/plugins/platforms/xcb/qxcbwindow.cpp ---- qtbase-opensource-src-5.5.1/src/plugins/platforms/xcb/qxcbwindow.cpp 2015-10-13 06:35:27.000000000 +0200 -+++ qtbase-opensource-src-5.5.1-new/src/plugins/platforms/xcb/qxcbwindow.cpp 2015-10-21 21:01:17.324562601 +0200 -@@ -694,12 +694,17 @@ void QXcbWindow::destroy() - m_pendingSyncRequest->invalidate(); - } - --void QXcbWindow::maybeSetScreen(QXcbScreen *screen) -+bool QXcbWindow::maybeSetScreen(QXcbScreen *screen) - { -- if (!window()->screen() && screen->geometry().contains(geometry().topLeft())) { -+ // Every window must have a screen. Otherwise application can -+ // crash and the window contents are invisible e.g. in x11vnc. -+ if (!window()->screen()) { - QWindowSystemInterface::handleWindowScreenChanged(window(), static_cast(screen)->screen()); -- QWindowSystemInterface::handleExposeEvent(window(), QRegion(QRect(QPoint(0, 0), window()->size()))); -+ if (screen->geometry().contains(geometry().topLeft())) -+ QWindowSystemInterface::handleExposeEvent(window(), QRegion(QRect(QPoint(0, 0), window()->size()))); -+ return true; - } -+ return false; - } - - void QXcbWindow::setGeometry(const QRect &rect) -@@ -1243,8 +1248,6 @@ void QXcbWindow::changeNetWmState(bool s - event.data.data32[3] = 0; - event.data.data32[4] = 0; - -- if (!xcbScreen()) -- return; - Q_XCB_CALL(xcb_send_event(xcb_connection(), 0, xcbScreen()->root(), XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *)&event)); - } - -@@ -1493,8 +1496,6 @@ void QXcbWindow::setParent(const QPlatfo - xcb_parent_id = qXcbParent->xcb_window(); - m_embedded = qXcbParent->window()->type() == Qt::ForeignWindow; - } else { -- if (!xcbScreen()) -- return; - xcb_parent_id = xcbScreen()->root(); - m_embedded = false; - } -@@ -2323,8 +2324,6 @@ void QXcbWindow::handleEnterNotifyEvent( - - const int dpr = int(devicePixelRatio()); - const QPoint local(event->event_x/dpr, event->event_y/dpr); -- if (!xcbScreen()) -- return; - QPoint global = xcbScreen()->mapFromNative(QPoint(event->root_x, event->root_y)); - QWindowSystemInterface::handleEnterEvent(window(), local, global); - } -@@ -2343,8 +2342,6 @@ void QXcbWindow::handleLeaveNotifyEvent( - if (enterWindow) { - const int dpr = int(devicePixelRatio()); - QPoint local(enter->event_x/dpr, enter->event_y/dpr); -- if (!xcbScreen()) -- return; - QPoint global = xcbScreen()->mapFromNative(QPoint(event->root_x, event->root_y)); - - QWindowSystemInterface::handleEnterLeaveEvent(enterWindow->window(), window(), local, global); -@@ -2360,8 +2357,6 @@ void QXcbWindow::handlePropertyNotifyEve - connection()->setTime(event->time); - - const bool propertyDeleted = event->state == XCB_PROPERTY_DELETE; -- if (!xcbScreen()) -- return; - - if (event->atom == atom(QXcbAtom::_NET_WM_STATE) || event->atom == atom(QXcbAtom::WM_STATE)) { - if (propertyDeleted) -@@ -2403,8 +2398,6 @@ void QXcbWindow::handlePropertyNotifyEve - return; - } else if (event->atom == atom(QXcbAtom::_NET_FRAME_EXTENTS)) { - m_dirtyFrameMargins = true; -- } else if (event->atom == atom(QXcbAtom::_NET_WORKAREA) && xcbScreen() && event->window == xcbScreen()->root()) { -- xcbScreen()->updateGeometry(event->time); - } - } - -@@ -2682,8 +2675,6 @@ bool QXcbWindow::needsSync() const - - void QXcbWindow::postSyncWindowRequest() - { -- if (!xcbScreen()) -- return; - if (!m_pendingSyncRequest) { - QXcbSyncWindowRequest *e = new QXcbSyncWindowRequest(this); - m_pendingSyncRequest = e; -diff -rupN qtbase-opensource-src-5.5.1/src/plugins/platforms/xcb/qxcbwindow.h qtbase-opensource-src-5.5.1-new/src/plugins/platforms/xcb/qxcbwindow.h ---- qtbase-opensource-src-5.5.1/src/plugins/platforms/xcb/qxcbwindow.h 2015-10-13 06:35:27.000000000 +0200 -+++ qtbase-opensource-src-5.5.1-new/src/plugins/platforms/xcb/qxcbwindow.h 2015-10-21 21:00:21.769613394 +0200 -@@ -158,7 +158,7 @@ public: - - virtual void create(); - virtual void destroy(); -- void maybeSetScreen(QXcbScreen *screen); -+ bool maybeSetScreen(QXcbScreen *screen); - QXcbScreen *screenForNativeGeometry(const QRect &newGeometry) const; - - public Q_SLOTS: From 7a8506bfbcd3dbf31fdc08627c2aa10570b13493 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Fri, 11 Dec 2015 22:46:03 -0600 Subject: [PATCH 13/62] sync latest xcb/screen/display related upstream commits --- 0001-XCB-prevent-a-fp-division-by-zero.patch | 58 ++ ...revious-state-when-sending-geometry-.patch | 86 +++ ...-Don-t-cache-the-screen-for-a-window.patch | 116 +++ ...older-QScreen-when-there-are-no-outp.patch | 721 ++++++++++++++++++ qt5-qtbase.spec | 21 +- 5 files changed, 995 insertions(+), 7 deletions(-) create mode 100644 0001-XCB-prevent-a-fp-division-by-zero.patch create mode 100644 0002-xcb-compare-to-previous-state-when-sending-geometry-.patch create mode 100644 0011-xcb-Don-t-cache-the-screen-for-a-window.patch create mode 100644 0012-xcb-Use-a-placeholder-QScreen-when-there-are-no-outp.patch diff --git a/0001-XCB-prevent-a-fp-division-by-zero.patch b/0001-XCB-prevent-a-fp-division-by-zero.patch new file mode 100644 index 0000000..9a186ab --- /dev/null +++ b/0001-XCB-prevent-a-fp-division-by-zero.patch @@ -0,0 +1,58 @@ +From 40c927e7331ea4ac9ca50de48560b700e657cded Mon Sep 17 00:00:00 2001 +From: Giuseppe D'Angelo +Date: Tue, 8 Dec 2015 18:28:24 +0100 +Subject: [PATCH 01/12] XCB: prevent a fp division by zero +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +For certain devices vci->resolution is zero, which causes a SIGFPE +if FE_INVALID exceptions are enabled. Try to prevent that. + +Task-number: QTBUG-42717 +Change-Id: I388735f5dfb6218496787dbb74cf0c0f43cc928f +Reviewed-by: Alexander Volkov +Reviewed-by: Błażej Szczygieł +Reviewed-by: Shawn Rutledge +--- + src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +index 8097cce..1a12370 100644 +--- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp ++++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +@@ -406,6 +406,9 @@ XInput2TouchDeviceData *QXcbConnection::touchDeviceForId(int id) + #endif // XCB_USE_XINPUT22 + case XIValuatorClass: { + XIValuatorClassInfo *vci = reinterpret_cast(classinfo); ++ // Some devices (mice) report a resolution of 0; they will be excluded later, ++ // for now just prevent a division by zero ++ const int vciResolution = vci->resolution ? vci->resolution : 1; + if (vci->label == atom(QXcbAtom::AbsMTPositionX)) + caps |= QTouchDevice::Position | QTouchDevice::NormalizedPosition; + else if (vci->label == atom(QXcbAtom::AbsMTTouchMajor)) +@@ -414,16 +417,16 @@ XInput2TouchDeviceData *QXcbConnection::touchDeviceForId(int id) + caps |= QTouchDevice::Pressure; + else if (vci->label == atom(QXcbAtom::RelX)) { + hasRelativeCoords = true; +- dev->size.setWidth((vci->max - vci->min) * 1000.0 / vci->resolution); ++ dev->size.setWidth((vci->max - vci->min) * 1000.0 / vciResolution); + } else if (vci->label == atom(QXcbAtom::RelY)) { + hasRelativeCoords = true; +- dev->size.setHeight((vci->max - vci->min) * 1000.0 / vci->resolution); ++ dev->size.setHeight((vci->max - vci->min) * 1000.0 / vciResolution); + } else if (vci->label == atom(QXcbAtom::AbsX)) { + caps |= QTouchDevice::Position; +- dev->size.setHeight((vci->max - vci->min) * 1000.0 / vci->resolution); ++ dev->size.setHeight((vci->max - vci->min) * 1000.0 / vciResolution); + } else if (vci->label == atom(QXcbAtom::AbsY)) { + caps |= QTouchDevice::Position; +- dev->size.setWidth((vci->max - vci->min) * 1000.0 / vci->resolution); ++ dev->size.setWidth((vci->max - vci->min) * 1000.0 / vciResolution); + } + break; + } +-- +2.5.0 + diff --git a/0002-xcb-compare-to-previous-state-when-sending-geometry-.patch b/0002-xcb-compare-to-previous-state-when-sending-geometry-.patch new file mode 100644 index 0000000..2c74c52 --- /dev/null +++ b/0002-xcb-compare-to-previous-state-when-sending-geometry-.patch @@ -0,0 +1,86 @@ +From 56f6252e7285c9c61a99416fa2a8571fd67c597f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= + +Date: Tue, 1 Dec 2015 16:27:09 +0100 +Subject: [PATCH 02/12] xcb: compare to previous state when sending geometry + and expose events +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +By calculating the previous geometry and passing it on when calling +handleGeometryChange we can detect cases where setGeometry() on a +QWindow didn't result in the expected geometry. The new (actual) +geometry is delivered as a resize event. + +This also allows us to only send expose events when the size of the +window has actually changed (instead of also sending when the window +has just moved). + +Due to the async delivery of geometry changes on the xcb platform we +need to avoid using QWindowPrivate's cached state of the geometry, as +that will result in duplicate resize events when events are not flushed +in between two system resize events coming in with the same size. + +Change-Id: I3d4abe4a1095dd96e6e354288d5b646c623c30dd +Reviewed-by: Tor Arne Vestbø +--- + src/plugins/platforms/xcb/qxcbwindow.cpp | 33 ++++++++++++++++++++++++++------ + 1 file changed, 27 insertions(+), 6 deletions(-) + +diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp +index 6023ee6..98bcc62 100644 +--- a/src/plugins/platforms/xcb/qxcbwindow.cpp ++++ b/src/plugins/platforms/xcb/qxcbwindow.cpp +@@ -2007,21 +2007,42 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t * + } + } + +- const QRect rect = QRect(pos, QSize(event->width, event->height)); +- QPlatformScreen *newScreen = parent() ? parent()->screen() : screenForGeometry(rect); ++ // The original geometry requested by setGeometry() might be different ++ // from what we end up with after applying window constraints. ++ QRect requestedGeometry = geometry(); ++ ++ const QRect actualGeometry = QRect(pos, QSize(event->width, event->height)); ++ QPlatformScreen *newScreen = parent() ? parent()->screen() : screenForGeometry(actualGeometry); + + QXcbScreen *currentScreen = m_xcbScreen; + m_xcbScreen = static_cast(newScreen); + if (!newScreen) + return; + +- QPlatformWindow::setGeometry(rect); +- QWindowSystemInterface::handleGeometryChange(window(), rect); ++ // Persist the actual geometry so that QWindow::geometry() can ++ // be queried in the resize event. ++ QPlatformWindow::setGeometry(actualGeometry); ++ ++ // As we're delivering the geometry change through QPA in n async fashion we can't ++ // pass on the current geometry of the QWindowPrivate, as that may have not been ++ // updated yet by a geometry change that's still in the QPA event queue. Instead ++ // we fall back to the default argument value of QRect(), which will result in ++ // QGuiApplication looking up the previous geometry from QWindowPrivate, but this ++ // time in sync with the even delivery/processing. ++ QWindowSystemInterface::handleGeometryChange(window(), actualGeometry, ++ requestedGeometry != actualGeometry ? requestedGeometry : QRect()); ++ + if (newScreen != currentScreen) + QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen()); + +- if (m_mapped) +- QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size())); ++ // For expose events we have no way of telling QGuiApplication to used the locally ++ // cached version of the previous state, so we may in some situations end up with ++ // an additional expose event. ++ QRect previousGeometry = requestedGeometry != actualGeometry ? ++ requestedGeometry : qt_window_private(window())->geometry; ++ ++ if (m_mapped && actualGeometry.size() != previousGeometry.size()) ++ QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), actualGeometry.size())); + + if (m_usingSyncProtocol && m_syncState == SyncReceived) + m_syncState = SyncAndConfigureReceived; +-- +2.5.0 + diff --git a/0011-xcb-Don-t-cache-the-screen-for-a-window.patch b/0011-xcb-Don-t-cache-the-screen-for-a-window.patch new file mode 100644 index 0000000..fdd795e --- /dev/null +++ b/0011-xcb-Don-t-cache-the-screen-for-a-window.patch @@ -0,0 +1,116 @@ +From 0c33a823c560bdf18a513ae460eea4d7bdf9e115 Mon Sep 17 00:00:00 2001 +From: Alexander Volkov +Date: Tue, 24 Nov 2015 15:09:41 +0300 +Subject: [PATCH 11/12] xcb: Don't cache the screen for a window +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +QXcbWindow::m_xcbScreen was introduced in 4e1b09fa8ff1a9ab42c0a29a2efe1ae7f4700d71 +(Keep screen geometries from overlapping) to map the window +geometry for the right screen, because it wasn't possible to +rely on QPlatformWindow::screen(). + +But we don't need it since a705b4ec1f6f7133390054f8b6b8077ef0550311 +(Introduce cross platform high-dpi scaling), because QGuiApplication +triggers GeometryChangeEvent right after processing WindowScreenChangedEvent. + +So just use QPlatformWindow::screen() instead of cached m_xcbScreen. + +m_xcbScreen was also used in d4bc56cb4218f6f8378f04c23865156b349b037d +(Fix screen detection on configureNotify) to compare the new screen +after receiving ConfigureNotify to the correct old screen. Just send +WindowScreenChangedEvent event and leave making the comparison to +QGuiApplication. + +Change-Id: Ibe717ae4bf4c40b0a04cd62fe2ecaee5df5f4060 +Reviewed-by: Błażej Szczygieł +Reviewed-by: Shawn Rutledge +--- + src/plugins/platforms/xcb/qxcbwindow.cpp | 16 ++++++---------- + src/plugins/platforms/xcb/qxcbwindow.h | 2 -- + 2 files changed, 6 insertions(+), 12 deletions(-) + +diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp +index 98bcc62..6add0a6 100644 +--- a/src/plugins/platforms/xcb/qxcbwindow.cpp ++++ b/src/plugins/platforms/xcb/qxcbwindow.cpp +@@ -143,7 +143,7 @@ const quint32 XEMBED_VERSION = 0; + + QXcbScreen *QXcbWindow::parentScreen() + { +- return parent() ? static_cast(parent())->parentScreen() : m_xcbScreen; ++ return parent() ? static_cast(parent())->parentScreen() : xcbScreen(); + } + + // Returns \c true if we should set WM_TRANSIENT_FOR on \a w +@@ -266,7 +266,6 @@ static const char *wm_window_type_property_id = "_q_xcb_wm_window_type"; + QXcbWindow::QXcbWindow(QWindow *window) + : QPlatformWindow(window) + , m_window(0) +- , m_xcbScreen(0) + , m_syncCounter(0) + , m_gravity(XCB_GRAVITY_STATIC) + , m_mapped(false) +@@ -322,7 +321,6 @@ void QXcbWindow::create() + QRect rect = windowGeometry(); + QXcbScreen *platformScreen = parent() ? parentScreen() : static_cast(screenForGeometry(rect)); + +- m_xcbScreen = platformScreen; + if (type == Qt::Desktop) { + m_window = platformScreen->root(); + m_depth = platformScreen->screen()->root_depth; +@@ -638,13 +636,12 @@ void QXcbWindow::setGeometry(const QRect &rect) + + propagateSizeHints(); + +- QXcbScreen *currentScreen = m_xcbScreen; ++ QXcbScreen *currentScreen = xcbScreen(); + QXcbScreen *newScreen = parent() ? parentScreen() : static_cast(screenForGeometry(rect)); + + if (!newScreen) + newScreen = xcbScreen(); + +- m_xcbScreen = newScreen; + const QRect wmGeometry = windowToWmGeometry(rect); + + if (newScreen && newScreen != currentScreen) +@@ -2013,9 +2010,6 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t * + + const QRect actualGeometry = QRect(pos, QSize(event->width, event->height)); + QPlatformScreen *newScreen = parent() ? parent()->screen() : screenForGeometry(actualGeometry); +- +- QXcbScreen *currentScreen = m_xcbScreen; +- m_xcbScreen = static_cast(newScreen); + if (!newScreen) + return; + +@@ -2032,8 +2026,10 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t * + QWindowSystemInterface::handleGeometryChange(window(), actualGeometry, + requestedGeometry != actualGeometry ? requestedGeometry : QRect()); + +- if (newScreen != currentScreen) +- QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen()); ++ // QPlatformScreen::screen() is updated asynchronously, so we can't compare it ++ // with the newScreen. Just send the WindowScreenChanged event and QGuiApplication ++ // will make the comparison later. ++ QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen()); + + // For expose events we have no way of telling QGuiApplication to used the locally + // cached version of the previous state, so we may in some situations end up with +diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h +index 43e66a7..0d14673 100644 +--- a/src/plugins/platforms/xcb/qxcbwindow.h ++++ b/src/plugins/platforms/xcb/qxcbwindow.h +@@ -214,8 +214,6 @@ protected: + + xcb_window_t m_window; + +- QXcbScreen *m_xcbScreen; +- + uint m_depth; + QImage::Format m_imageFormat; + bool m_imageRgbSwap; +-- +2.5.0 + diff --git a/0012-xcb-Use-a-placeholder-QScreen-when-there-are-no-outp.patch b/0012-xcb-Use-a-placeholder-QScreen-when-there-are-no-outp.patch new file mode 100644 index 0000000..665827e --- /dev/null +++ b/0012-xcb-Use-a-placeholder-QScreen-when-there-are-no-outp.patch @@ -0,0 +1,721 @@ +From a094af001795c9651b299d700a992150d1aba33a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= +Date: Fri, 16 Oct 2015 22:51:59 +0200 +Subject: [PATCH 12/12] xcb: Use a placeholder QScreen when there are no + outputs connected + +If no screens are available, windows could disappear, could stop rendering +graphics, or the application could crash. This is a real use case in several +scenarios: with x11vnc, when all monitors are physically disconnected from a +desktop machine, or in some cases even when the monitor sleeps. Now when the +last screen is disconnected, it is transformed into a fake screen. When a +physical screen appears, the fake QScreen is transformed into a representation +of the physical screen. Every virtual desktop has its own fake screen, and +primary screens must belong to the primary virtual desktop. It fixes updating +screen geometry on temporarily disabled screens in the middle of the mode +switch. + +Expected results: Windows don't disappear, the application doesn't +crash, and QMenu is displayed on the appropriate screen. + +This reverts patch 51ada7734ad780178ecced11e0dff454dfc2e5f2 + +Change-Id: I6e8eb682b0c8425d08ffdaecbd4c6c7700c914b4 +Task-number: QTBUG-42985 +Reviewed-by: Shawn Rutledge +--- + src/gui/kernel/qscreen.cpp | 4 +- + src/plugins/platforms/xcb/qxcbconnection.cpp | 273 +++++++++++++++------------ + src/plugins/platforms/xcb/qxcbconnection.h | 10 +- + src/plugins/platforms/xcb/qxcbscreen.cpp | 49 +++-- + src/plugins/platforms/xcb/qxcbscreen.h | 10 +- + src/plugins/platforms/xcb/qxcbwindow.cpp | 38 +--- + src/plugins/platforms/xcb/qxcbwindow.h | 1 - + 7 files changed, 212 insertions(+), 173 deletions(-) + +diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp +index fb322ae..52e7686 100644 +--- a/src/gui/kernel/qscreen.cpp ++++ b/src/gui/kernel/qscreen.cpp +@@ -116,8 +116,8 @@ QScreen::~QScreen() + bool movingFromVirtualSibling = primaryScreen && primaryScreen->handle()->virtualSiblings().contains(handle()); + + // Move any leftover windows to the primary screen +- foreach (QWindow *window, QGuiApplication::topLevelWindows()) { +- if (window->screen() != this) ++ foreach (QWindow *window, QGuiApplication::allWindows()) { ++ if (!window->isTopLevel() || window->screen() != this) + continue; + + const bool wasVisible = window->isVisible(); +diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp +index 50d49ca..231fe9a 100644 +--- a/src/plugins/platforms/xcb/qxcbconnection.cpp ++++ b/src/plugins/platforms/xcb/qxcbconnection.cpp +@@ -179,42 +179,6 @@ QXcbScreen* QXcbConnection::findScreenForOutput(xcb_window_t rootWindow, xcb_ran + return 0; + } + +-QXcbScreen* QXcbConnection::createScreen(QXcbVirtualDesktop* virtualDesktop, +- xcb_randr_output_t outputId, +- xcb_randr_get_output_info_reply_t *output) +-{ +- QString name; +- if (output) +- name = QString::fromUtf8((const char*)xcb_randr_get_output_info_name(output), +- xcb_randr_get_output_info_name_length(output)); +- else { +- QByteArray displayName = m_displayName; +- int dotPos = displayName.lastIndexOf('.'); +- if (dotPos != -1) +- displayName.truncate(dotPos); +- name = QString::fromLocal8Bit(displayName) + QLatin1Char('.') + QString::number(virtualDesktop->number()); +- } +- +- return new QXcbScreen(this, virtualDesktop, outputId, output, name); +-} +- +-bool QXcbConnection::checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output) +-{ +- xcb_generic_error_t *error = 0; +- xcb_randr_get_output_primary_cookie_t primaryCookie = +- xcb_randr_get_output_primary(xcb_connection(), rootWindow); +- QScopedPointer primary ( +- xcb_randr_get_output_primary_reply(xcb_connection(), primaryCookie, &error)); +- if (!primary || error) { +- qWarning("failed to get the primary output of the screen"); +- free(error); +- error = NULL; +- } +- const bool isPrimary = primary ? (primary->output == output) : false; +- +- return isPrimary; +-} +- + QXcbVirtualDesktop* QXcbConnection::virtualDesktopForRootWindow(xcb_window_t rootWindow) + { + foreach (QXcbVirtualDesktop *virtualDesktop, m_virtualDesktops) { +@@ -237,8 +201,9 @@ void QXcbConnection::updateScreens(const xcb_randr_notify_event_t *event) + // Not for us + return; + +- qCDebug(lcQpaScreen) << "QXcbConnection: XCB_RANDR_NOTIFY_CRTC_CHANGE:" << crtc.crtc; + QXcbScreen *screen = findScreenForCrtc(crtc.window, crtc.crtc); ++ qCDebug(lcQpaScreen) << "QXcbConnection: XCB_RANDR_NOTIFY_CRTC_CHANGE:" << crtc.crtc ++ << "mode" << crtc.mode << "relevant screen" << screen; + // Only update geometry when there's a valid mode on the CRTC + // CRTC with node mode could mean that output has been disabled, and we'll + // get RRNotifyOutputChange notification for that. +@@ -260,16 +225,7 @@ void QXcbConnection::updateScreens(const xcb_randr_notify_event_t *event) + + if (screen && output.connection == XCB_RANDR_CONNECTION_DISCONNECTED) { + qCDebug(lcQpaScreen) << "screen" << screen->name() << "has been disconnected"; +- +- // Known screen removed -> delete it +- m_screens.removeOne(screen); +- virtualDesktop->removeScreen(screen); +- +- QXcbIntegration::instance()->destroyScreen(screen); +- +- // QTBUG-40174, QTBUG-42985: If all screens are removed, wait +- // and start rendering again later if a screen becomes available. +- ++ destroyScreen(screen); + } else if (!screen && output.connection == XCB_RANDR_CONNECTION_CONNECTED) { + // New XRandR output is available and it's enabled + if (output.crtc != XCB_NONE && output.mode != XCB_NONE) { +@@ -278,59 +234,142 @@ void QXcbConnection::updateScreens(const xcb_randr_notify_event_t *event) + QScopedPointer outputInfo( + xcb_randr_get_output_info_reply(xcb_connection(), outputInfoCookie, NULL)); + +- screen = createScreen(virtualDesktop, output.output, outputInfo.data()); +- qCDebug(lcQpaScreen) << "output" << screen->name() << "is connected and enabled"; +- +- screen->setPrimary(checkOutputIsPrimary(output.window, output.output)); +- virtualDesktop->addScreen(screen); +- m_screens << screen; +- QXcbIntegration::instance()->screenAdded(screen, screen->isPrimary()); ++ // Find a fake screen ++ foreach (QPlatformScreen *scr, virtualDesktop->screens()) { ++ QXcbScreen *xcbScreen = (QXcbScreen *)scr; ++ if (xcbScreen->output() == XCB_NONE) { ++ screen = xcbScreen; ++ break; ++ } ++ } + +- // Windows which had null screens have already had expose events by now. +- // They need to be told the screen is back, it's OK to render. +- foreach (QWindow *window, QGuiApplication::topLevelWindows()) { +- QXcbWindow *xcbWin = static_cast(window->handle()); +- if (xcbWin) +- xcbWin->maybeSetScreen(screen); ++ if (screen) { ++ QString nameWas = screen->name(); ++ // Transform the fake screen into a physical screen ++ screen->setOutput(output.output, outputInfo.data()); ++ updateScreen(screen, output); ++ qCDebug(lcQpaScreen) << "output" << screen->name() ++ << "is connected and enabled; was fake:" << nameWas; ++ } else { ++ screen = createScreen(virtualDesktop, output, outputInfo.data()); ++ qCDebug(lcQpaScreen) << "output" << screen->name() << "is connected and enabled"; + } + } +- // else ignore disabled screens + } else if (screen) { +- // Screen has been disabled -> remove + if (output.crtc == XCB_NONE && output.mode == XCB_NONE) { ++ // Screen has been disabled + 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); +- virtualDesktop->removeScreen(screen); +- QXcbIntegration::instance()->destroyScreen(screen); ++ destroyScreen(screen); + } else { + qCDebug(lcQpaScreen) << "output" << screen->name() << "has been temporarily disabled for the mode switch"; ++ // Reset crtc to skip RRCrtcChangeNotify events, ++ // because they may be invalid in the middle of the mode switch ++ screen->setCrtc(XCB_NONE); + } + } else { +- // Just update existing screen +- screen->updateGeometry(output.config_timestamp); +- const bool wasPrimary = screen->isPrimary(); +- screen->setPrimary(checkOutputIsPrimary(output.window, output.output)); +- if (screen->mode() != output.mode) +- screen->updateRefreshRate(output.mode); +- +- // If the screen became primary, reshuffle the order in QGuiApplicationPrivate +- if (!wasPrimary && screen->isPrimary()) { +- const int idx = m_screens.indexOf(screen); +- m_screens.swap(0, idx); +- QXcbIntegration::instance()->setPrimaryScreen(screen); +- } ++ updateScreen(screen, output); + qCDebug(lcQpaScreen) << "output has changed" << screen; + } + } ++ ++ qCDebug(lcQpaScreen) << "primary output is" << m_screens.first()->name(); ++ } ++} ++ ++bool QXcbConnection::checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output) ++{ ++ xcb_generic_error_t *error = 0; ++ xcb_randr_get_output_primary_cookie_t primaryCookie = ++ xcb_randr_get_output_primary(xcb_connection(), rootWindow); ++ QScopedPointer primary ( ++ xcb_randr_get_output_primary_reply(xcb_connection(), primaryCookie, &error)); ++ if (!primary || error) { ++ qWarning("failed to get the primary output of the screen"); ++ free(error); ++ error = NULL; ++ } ++ const bool isPrimary = primary ? (primary->output == output) : false; ++ ++ return isPrimary; ++} ++ ++void QXcbConnection::updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange) ++{ ++ screen->setCrtc(outputChange.crtc); // Set the new crtc, because it can be invalid ++ screen->updateGeometry(outputChange.config_timestamp); ++ if (screen->mode() != outputChange.mode) ++ screen->updateRefreshRate(outputChange.mode); ++ // Only screen which belongs to the primary virtual desktop can be a primary screen ++ if (screen->screenNumber() == m_primaryScreenNumber) { ++ if (!screen->isPrimary() && checkOutputIsPrimary(outputChange.window, outputChange.output)) { ++ screen->setPrimary(true); ++ ++ // If the screen became primary, reshuffle the order in QGuiApplicationPrivate ++ const int idx = m_screens.indexOf(screen); ++ if (idx > 0) { ++ m_screens.first()->setPrimary(false); ++ m_screens.swap(0, idx); ++ } ++ screen->virtualDesktop()->setPrimaryScreen(screen); ++ QXcbIntegration::instance()->setPrimaryScreen(screen); ++ } ++ } ++} ++ ++QXcbScreen *QXcbConnection::createScreen(QXcbVirtualDesktop *virtualDesktop, ++ const xcb_randr_output_change_t &outputChange, ++ xcb_randr_get_output_info_reply_t *outputInfo) ++{ ++ QXcbScreen *screen = new QXcbScreen(this, virtualDesktop, outputChange.output, outputInfo); ++ // Only screen which belongs to the primary virtual desktop can be a primary screen ++ if (screen->screenNumber() == m_primaryScreenNumber) ++ screen->setPrimary(checkOutputIsPrimary(outputChange.window, outputChange.output)); ++ ++ if (screen->isPrimary()) { + if (!m_screens.isEmpty()) +- qCDebug(lcQpaScreen) << "primary output is" << m_screens.first()->name(); +- else +- qCDebug(lcQpaScreen) << "no outputs"; ++ m_screens.first()->setPrimary(false); ++ ++ m_screens.prepend(screen); ++ } else { ++ m_screens.append(screen); ++ } ++ virtualDesktop->addScreen(screen); ++ QXcbIntegration::instance()->screenAdded(screen, screen->isPrimary()); ++ ++ return screen; ++} ++ ++void QXcbConnection::destroyScreen(QXcbScreen *screen) ++{ ++ QXcbVirtualDesktop *virtualDesktop = screen->virtualDesktop(); ++ if (virtualDesktop->screens().count() == 1) { ++ // If there are no other screens on the same virtual desktop, ++ // then transform the physical screen into a fake screen. ++ const QString nameWas = screen->name(); ++ screen->setOutput(XCB_NONE, Q_NULLPTR); ++ qCDebug(lcQpaScreen) << "transformed" << nameWas << "to fake" << screen; ++ } else { ++ // There is more than one screen on the same virtual desktop, remove the screen ++ m_screens.removeOne(screen); ++ virtualDesktop->removeScreen(screen); ++ ++ // When primary screen is removed, set the new primary screen ++ // which belongs to the primary virtual desktop. ++ if (screen->isPrimary()) { ++ QXcbScreen *newPrimary = (QXcbScreen *)virtualDesktop->screens().at(0); ++ newPrimary->setPrimary(true); ++ const int idx = m_screens.indexOf(newPrimary); ++ if (idx > 0) ++ m_screens.swap(0, idx); ++ QXcbIntegration::instance()->setPrimaryScreen(newPrimary); ++ } ++ ++ QXcbIntegration::instance()->destroyScreen(screen); + } + } + +@@ -338,8 +377,7 @@ void QXcbConnection::initializeScreens() + { + xcb_screen_iterator_t it = xcb_setup_roots_iterator(m_setup); + int xcbScreenNumber = 0; // screen number in the xcb sense +- QXcbScreen* primaryScreen = Q_NULLPTR; +- bool hasOutputs = false; ++ QXcbScreen *primaryScreen = Q_NULLPTR; + while (it.rem) { + // Each "screen" in xcb terminology is a virtual desktop, + // potentially a collection of separate juxtaposed monitors. +@@ -348,8 +386,6 @@ void QXcbConnection::initializeScreens() + xcb_screen_t *xcbScreen = it.data; + QXcbVirtualDesktop *virtualDesktop = new QXcbVirtualDesktop(this, xcbScreen, xcbScreenNumber); + m_virtualDesktops.append(virtualDesktop); +- QList siblings; +- int outputCount = 0; + if (has_randr_extension) { + xcb_generic_error_t *error = NULL; + // RRGetScreenResourcesCurrent is fast but it may return nothing if the +@@ -366,7 +402,7 @@ void QXcbConnection::initializeScreens() + } else { + xcb_timestamp_t timestamp; + xcb_randr_output_t *outputs = Q_NULLPTR; +- outputCount = xcb_randr_get_screen_resources_current_outputs_length(resources_current.data()); ++ int outputCount = xcb_randr_get_screen_resources_current_outputs_length(resources_current.data()); + if (outputCount) { + timestamp = resources_current->config_timestamp; + outputs = xcb_randr_get_screen_resources_current_outputs(resources_current.data()); +@@ -393,6 +429,7 @@ void QXcbConnection::initializeScreens() + qWarning("failed to get the primary output of the screen"); + free(error); + } else { ++ QList siblings; + for (int i = 0; i < outputCount; i++) { + QScopedPointer output( + xcb_randr_get_output_info_reply(xcb_connection(), +@@ -416,9 +453,8 @@ void QXcbConnection::initializeScreens() + continue; + } + +- QXcbScreen *screen = createScreen(virtualDesktop, outputs[i], output.data()); ++ QXcbScreen *screen = new QXcbScreen(this, virtualDesktop, outputs[i], output.data()); + siblings << screen; +- hasOutputs = true; + m_screens << screen; + + // There can be multiple outputs per screen, use either +@@ -435,11 +471,23 @@ void QXcbConnection::initializeScreens() + } + } + } ++ virtualDesktop->setScreens(siblings); + } + } + } + } +- virtualDesktop->setScreens(siblings); ++ if (virtualDesktop->screens().isEmpty()) { ++ // If there are no XRandR outputs or XRandR extension is missing, ++ // then create a fake/legacy screen. ++ QXcbScreen *screen = new QXcbScreen(this, virtualDesktop, XCB_NONE, Q_NULLPTR); ++ qCDebug(lcQpaScreen) << "created fake screen" << screen; ++ m_screens << screen; ++ if (m_primaryScreenNumber == xcbScreenNumber) { ++ primaryScreen = screen; ++ primaryScreen->setPrimary(true); ++ } ++ virtualDesktop->addScreen(screen); ++ } + xcb_screen_next(&it); + ++xcbScreenNumber; + } // for each xcb screen +@@ -447,39 +495,25 @@ void QXcbConnection::initializeScreens() + foreach (QXcbVirtualDesktop *virtualDesktop, m_virtualDesktops) + virtualDesktop->subscribeToXFixesSelectionNotify(); + +- // If there's no randr extension, or there was some error above, or we found a +- // screen which doesn't have outputs for some other reason (e.g. on VNC or ssh -X), +- // but the dimensions are known anyway, and we don't already have any lingering +- // (possibly disconnected) screens, then showing windows should be possible, +- // so create one screen. (QTBUG-31389) +- QXcbVirtualDesktop *virtualDesktop = m_virtualDesktops.value(0); +- if (virtualDesktop && !hasOutputs && !virtualDesktop->size().isEmpty() && m_screens.isEmpty()) { +- QXcbScreen *screen = createScreen(virtualDesktop, 0, Q_NULLPTR); +- virtualDesktop->setScreens(QList() << screen); +- m_screens << screen; +- primaryScreen = screen; +- primaryScreen->setPrimary(true); +- qCDebug(lcQpaScreen) << "found a screen with zero outputs" << screen; +- } +- +- // Ensure the primary screen is first in the list +- if (primaryScreen) { +- Q_ASSERT(!m_screens.isEmpty()); +- if (m_screens.first() != primaryScreen) { +- m_screens.removeOne(primaryScreen); +- m_screens.prepend(primaryScreen); ++ if (m_virtualDesktops.isEmpty()) { ++ qFatal("QXcbConnection: no screens available"); ++ } else { ++ // Ensure the primary screen is first on the list ++ if (primaryScreen) { ++ if (m_screens.first() != primaryScreen) { ++ m_screens.removeOne(primaryScreen); ++ m_screens.prepend(primaryScreen); ++ } + } +- } + +- // Push the screens to QApplication +- QXcbIntegration *integration = QXcbIntegration::instance(); +- foreach (QXcbScreen* screen, m_screens) { +- qCDebug(lcQpaScreen) << "adding" << screen << "(Primary:" << screen->isPrimary() << ')'; +- integration->screenAdded(screen, screen->isPrimary()); +- } ++ // Push the screens to QGuiApplication ++ foreach (QXcbScreen *screen, m_screens) { ++ qCDebug(lcQpaScreen) << "adding" << screen << "(Primary:" << screen->isPrimary() << ")"; ++ QXcbIntegration::instance()->screenAdded(screen, screen->isPrimary()); ++ } + +- if (!m_screens.isEmpty()) + qCDebug(lcQpaScreen) << "primary output is" << m_screens.first()->name(); ++ } + } + + QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName) +@@ -553,9 +587,6 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra + initializeXFixes(); + initializeScreens(); + +- if (m_screens.isEmpty()) +- qFatal("QXcbConnection: no screens available"); +- + initializeXRender(); + m_xi2Enabled = false; + #if defined(XCB_USE_XINPUT2) +diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h +index 3c82170..fb7cc13 100644 +--- a/src/plugins/platforms/xcb/qxcbconnection.h ++++ b/src/plugins/platforms/xcb/qxcbconnection.h +@@ -518,15 +518,17 @@ private: + void initializeXShape(); + void initializeXKB(); + void handleClientMessageEvent(const xcb_client_message_event_t *event); +- QXcbScreen* createScreen(QXcbVirtualDesktop *virtualDesktop, +- xcb_randr_output_t outputId = XCB_NONE, +- xcb_randr_get_output_info_reply_t *output = 0); + QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc); + QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output); + QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow); ++ void updateScreens(const xcb_randr_notify_event_t *event); + bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); ++ void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); ++ QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, ++ const xcb_randr_output_change_t &outputChange, ++ xcb_randr_get_output_info_reply_t *outputInfo); ++ void destroyScreen(QXcbScreen *screen); + void initializeScreens(); +- void updateScreens(const xcb_randr_notify_event_t *event); + bool compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const; + + bool m_xi2Enabled; +diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp +index 0e99d58..f05432e 100644 +--- a/src/plugins/platforms/xcb/qxcbscreen.cpp ++++ b/src/plugins/platforms/xcb/qxcbscreen.cpp +@@ -81,6 +81,13 @@ void QXcbVirtualDesktop::addScreen(QPlatformScreen *s) + ((QXcbScreen *) s)->isPrimary() ? m_screens.prepend(s) : m_screens.append(s); + } + ++void QXcbVirtualDesktop::setPrimaryScreen(QPlatformScreen *s) ++{ ++ const int idx = m_screens.indexOf(s); ++ Q_ASSERT(idx > -1); ++ m_screens.swap(0, idx); ++} ++ + QXcbXSettings *QXcbVirtualDesktop::xSettings() const + { + if (!m_xSettings) { +@@ -149,16 +156,15 @@ void QXcbVirtualDesktop::updateWorkArea() + } + + QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, +- xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *output, +- QString outputName) ++ xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *output) + : QXcbObject(connection) + , m_virtualDesktop(virtualDesktop) + , m_output(outputId) +- , m_crtc(output ? output->crtc : 0) ++ , m_crtc(output ? output->crtc : XCB_NONE) + , m_mode(XCB_NONE) + , m_primary(false) + , m_rotation(XCB_RANDR_ROTATION_ROTATE_0) +- , m_outputName(outputName) ++ , m_outputName(getOutputName(output)) + , m_outputSizeMillimeters(output ? QSize(output->mm_width, output->mm_height) : QSize()) + , m_virtualSize(virtualDesktop->size()) + , m_virtualSizeMillimeters(virtualDesktop->physicalSize()) +@@ -268,6 +274,22 @@ QXcbScreen::~QXcbScreen() + delete m_cursor; + } + ++QString QXcbScreen::getOutputName(xcb_randr_get_output_info_reply_t *outputInfo) ++{ ++ QString name; ++ if (outputInfo) { ++ name = QString::fromUtf8((const char*)xcb_randr_get_output_info_name(outputInfo), ++ xcb_randr_get_output_info_name_length(outputInfo)); ++ } else { ++ QByteArray displayName = connection()->displayName(); ++ int dotPos = displayName.lastIndexOf('.'); ++ if (dotPos != -1) ++ displayName.truncate(dotPos); ++ name = QString::fromLocal8Bit(displayName) + QLatin1Char('.') ++ + QString::number(m_virtualDesktop->number()); ++ } ++ return name; ++} + + QWindow *QXcbScreen::topLevelAt(const QPoint &p) const + { +@@ -392,6 +414,16 @@ QPlatformCursor *QXcbScreen::cursor() const + return m_cursor; + } + ++void QXcbScreen::setOutput(xcb_randr_output_t outputId, ++ xcb_randr_get_output_info_reply_t *outputInfo) ++{ ++ m_output = outputId; ++ m_crtc = outputInfo ? outputInfo->crtc : XCB_NONE; ++ m_mode = XCB_NONE; ++ m_outputName = getOutputName(outputInfo); ++ // TODO: Send an event to the QScreen instance that the screen changed its name ++} ++ + /*! + \brief handle the XCB screen change event and update properties + +@@ -460,19 +492,10 @@ void QXcbScreen::handleScreenChange(xcb_randr_screen_change_notify_event_t *chan + + updateGeometry(change_event->timestamp); + +- QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), geometry(), availableGeometry()); + QWindowSystemInterface::handleScreenOrientationChange(QPlatformScreen::screen(), m_orientation); + + QDpi ldpi = logicalDpi(); + QWindowSystemInterface::handleScreenLogicalDotsPerInchChange(QPlatformScreen::screen(), ldpi.first, ldpi.second); +- +- // Windows which had null screens have already had expose events by now. +- // They need to be told the screen is back, it's OK to render. +- foreach (QWindow *window, QGuiApplication::topLevelWindows()) { +- QXcbWindow *xcbWin = static_cast(window->handle()); +- if (xcbWin) +- xcbWin->maybeSetScreen(this); +- } + } + + void QXcbScreen::updateGeometry(xcb_timestamp_t timestamp) +diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h +index c68c290..79620f4 100644 +--- a/src/plugins/platforms/xcb/qxcbscreen.h ++++ b/src/plugins/platforms/xcb/qxcbscreen.h +@@ -72,6 +72,7 @@ public: + void setScreens(QList sl) { m_screens = sl; } + void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } + void addScreen(QPlatformScreen *s); ++ void setPrimaryScreen(QPlatformScreen *s); + + QXcbXSettings *xSettings() const; + +@@ -101,10 +102,11 @@ class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen + { + public: + QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, +- xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *output, +- QString outputName); ++ xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); + ~QXcbScreen(); + ++ QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); ++ + QPixmap grabWindow(WId window, int x, int y, int width, int height) const Q_DECL_OVERRIDE; + + QWindow *topLevelAt(const QPoint &point) const Q_DECL_OVERRIDE; +@@ -137,6 +139,10 @@ public: + xcb_randr_crtc_t crtc() const { return m_crtc; } + xcb_randr_mode_t mode() const { return m_mode; } + ++ void setOutput(xcb_randr_output_t outputId, ++ xcb_randr_get_output_info_reply_t *outputInfo); ++ void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } ++ + void windowShown(QXcbWindow *window); + QString windowManagerName() const { return m_windowManagerName; } + bool syncRequestSupported() const { return m_syncRequestSupported; } +diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp +index 6add0a6..bdbb9e9 100644 +--- a/src/plugins/platforms/xcb/qxcbwindow.cpp ++++ b/src/plugins/platforms/xcb/qxcbwindow.cpp +@@ -622,14 +622,6 @@ void QXcbWindow::destroy() + m_pendingSyncRequest->invalidate(); + } + +-void QXcbWindow::maybeSetScreen(QXcbScreen *screen) +-{ +- if (!window()->screen() && screen->geometry().contains(geometry().topLeft())) { +- QWindowSystemInterface::handleWindowScreenChanged(window(), static_cast(screen)->screen()); +- QWindowSystemInterface::handleExposeEvent(window(), QRegion(QRect(QPoint(0, 0), window()->size()))); +- } +-} +- + void QXcbWindow::setGeometry(const QRect &rect) + { + QPlatformWindow::setGeometry(rect); +@@ -845,15 +837,13 @@ void QXcbWindow::hide() + Q_XCB_CALL(xcb_unmap_window(xcb_connection(), m_window)); + + // send synthetic UnmapNotify event according to icccm 4.1.4 +- if (xcbScreen()) { +- xcb_unmap_notify_event_t event; +- event.response_type = XCB_UNMAP_NOTIFY; +- event.event = xcbScreen()->root(); +- event.window = m_window; +- event.from_configure = false; +- Q_XCB_CALL(xcb_send_event(xcb_connection(), false, xcbScreen()->root(), +- XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *)&event)); +- } ++ xcb_unmap_notify_event_t event; ++ event.response_type = XCB_UNMAP_NOTIFY; ++ event.event = xcbScreen()->root(); ++ event.window = m_window; ++ event.from_configure = false; ++ Q_XCB_CALL(xcb_send_event(xcb_connection(), false, xcbScreen()->root(), ++ XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *)&event)); + + xcb_flush(xcb_connection()); + +@@ -1181,8 +1171,6 @@ void QXcbWindow::changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two) + event.data.data32[3] = 0; + event.data.data32[4] = 0; + +- if (!xcbScreen()) +- return; + Q_XCB_CALL(xcb_send_event(xcb_connection(), 0, xcbScreen()->root(), XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *)&event)); + } + +@@ -1435,8 +1423,6 @@ void QXcbWindow::setParent(const QPlatformWindow *parent) + xcb_parent_id = qXcbParent->xcb_window(); + m_embedded = qXcbParent->window()->type() == Qt::ForeignWindow; + } else { +- if (!xcbScreen()) +- return; + xcb_parent_id = xcbScreen()->root(); + m_embedded = false; + } +@@ -1992,7 +1978,7 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t * + { + bool fromSendEvent = (event->response_type & 0x80); + QPoint pos(event->x, event->y); +- if (!parent() && !fromSendEvent && xcbScreen()) { ++ if (!parent() && !fromSendEvent) { + // Do not trust the position, query it instead. + xcb_translate_coordinates_cookie_t cookie = xcb_translate_coordinates(xcb_connection(), xcb_window(), + xcbScreen()->root(), 0, 0); +@@ -2305,8 +2291,6 @@ void QXcbWindow::handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) + return; + + const QPoint local(event->event_x, event->event_y); +- if (!xcbScreen()) +- return; + QPoint global = QPoint(event->root_x, event->root_y); + QWindowSystemInterface::handleEnterEvent(window(), local, global); + } +@@ -2324,8 +2308,6 @@ void QXcbWindow::handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) + + if (enterWindow) { + QPoint local(enter->event_x, enter->event_y); +- if (!xcbScreen()) +- return; + QPoint global = QPoint(event->root_x, event->root_y); + + QWindowSystemInterface::handleEnterLeaveEvent(enterWindow->window(), window(), local, global); +@@ -2341,8 +2323,6 @@ void QXcbWindow::handlePropertyNotifyEvent(const xcb_property_notify_event_t *ev + connection()->setTime(event->time); + + const bool propertyDeleted = event->state == XCB_PROPERTY_DELETE; +- if (!xcbScreen()) +- return; + + if (event->atom == atom(QXcbAtom::_NET_WM_STATE) || event->atom == atom(QXcbAtom::WM_STATE)) { + if (propertyDeleted) +@@ -2662,8 +2642,6 @@ bool QXcbWindow::needsSync() const + + void QXcbWindow::postSyncWindowRequest() + { +- if (!xcbScreen()) +- return; + if (!m_pendingSyncRequest) { + QXcbSyncWindowRequest *e = new QXcbSyncWindowRequest(this); + m_pendingSyncRequest = e; +diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h +index 0d14673..69c0819 100644 +--- a/src/plugins/platforms/xcb/qxcbwindow.h ++++ b/src/plugins/platforms/xcb/qxcbwindow.h +@@ -167,7 +167,6 @@ public: + + virtual void create(); + virtual void destroy(); +- void maybeSetScreen(QXcbScreen *screen); + QXcbScreen *screenForNativeGeometry(const QRect &newGeometry) const; + + public Q_SLOTS: +-- +2.5.0 + diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 2a1bbe4..3215fd8 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -39,7 +39,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.7%{?dist} +Release: 0.8%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -73,15 +73,16 @@ Patch50: qt5-poll.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1083664 Patch51: qtbase-opensource-src-5.5-disconnect_displays.patch -# xcb: QScreen is a placeholder whenever there are no outputs connected -# https://codereview.qt-project.org/#/c/138201/ -Patch52: qtbase-opensource-src-5.6.0-xcb-gerrit-138201.patch - ## upstream patches # workaround https://bugreports.qt-project.org/browse/QTBUG-43057 # 'make docs' crash on el6, use qSort instead of std::sort Patch100: qtbase-opensource-src-5.4.0-QTBUG-43057.patch +Patch101: 0001-XCB-prevent-a-fp-division-by-zero.patch +Patch102: 0002-xcb-compare-to-previous-state-when-sending-geometry-.patch +Patch111: 0011-xcb-Don-t-cache-the-screen-for-a-window.patch +Patch112: 0012-xcb-Use-a-placeholder-QScreen-when-there-are-no-outp.patch + # macros, be mindful to keep sync'd with macros.qt5 Source10: macros.qt5 %define _qt5 %{name} @@ -321,12 +322,15 @@ rm -fv mkspecs/linux-g++*/qmake.conf.multilib-optflags %patch51 -p1 -b .disconnect_displays -%patch52 -p1 -b .138201 - %if 0%{?rhel} == 6 %patch100 -p1 -b .QTBUG-43057 %endif +%patch101 -p1 -b .0001 +%patch102 -p1 -b .0002 +%patch111 -p1 -b .0011 +%patch112 -p1 -b .0012 + # drop -fexceptions from $RPM_OPT_FLAGS RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's|-fexceptions||g'` @@ -865,6 +869,9 @@ fi %changelog +* Fri Dec 11 2015 Rex Dieter 5.6.0-0.8 +- sync latest xcb/screen/display related upstream commits + * Thu Dec 10 2015 Helio Chissini de Castro - 5.6.0-0.7 - Official beta release From 72610001f04c179fc02ebd0957fb5fb017e7f803 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Sat, 12 Dec 2015 18:17:38 -0600 Subject: [PATCH 14/62] drop disconnect_displays.patch so we can better test latest xcb/display work --- qt5-qtbase.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 3215fd8..0cb60b1 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -39,7 +39,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.8%{?dist} +Release: 0.9%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -320,7 +320,7 @@ rm -fv mkspecs/linux-g++*/qmake.conf.multilib-optflags %patch4 -p1 -b .QTBUG-35459 %patch12 -p1 -b .enable_ft_lcdfilter -%patch51 -p1 -b .disconnect_displays +#patch51 -p1 -b .disconnect_displays %if 0%{?rhel} == 6 %patch100 -p1 -b .QTBUG-43057 @@ -869,6 +869,9 @@ fi %changelog +* Sat Dec 12 2015 Rex Dieter 5.6.0-0.9 +- drop disconnect_displays.patch so we can better test latest xcb/display work + * Fri Dec 11 2015 Rex Dieter 5.6.0-0.8 - sync latest xcb/screen/display related upstream commits From d3f4ecabeeacb79029b85289336945390d99ce4b Mon Sep 17 00:00:00 2001 From: Helio Chissini de Castro Date: Sun, 13 Dec 2015 20:10:44 +0100 Subject: [PATCH 15/62] - Enable gold and remove reduced relocations --- qt5-qtbase.spec | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 2a1bbe4..4260936 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -39,7 +39,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.7%{?dist} +Release: 0.8%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -189,13 +189,6 @@ Requires: %{name}-common = %{version}-%{release} %define tds -no-sql-tds %endif -# workaround gold linker bug by not using it -# https://bugzilla.redhat.com/show_bug.cgi?id=1193044 -#https://sourceware.org/bugzilla/show_bug.cgi?id=16992 -%if 0%{?fedora} > 21 -%define use_gold_linker -no-use-gold-linker -%endif - %description Qt is a software toolkit for developing applications. @@ -358,7 +351,6 @@ test -x configure || chmod +x configure %build -# limit -reduce-relocations to %%ix86 x86_64 archs, https://bugreports.qt-project.org/browse/QTBUG-36129 ./configure -v \ -confirm-license \ -opensource \ @@ -397,9 +389,6 @@ test -x configure || chmod +x configure -no-sse2 \ %endif -no-strip \ -%ifarch %{ix86} x86_64 - -reduce-relocations \ -%endif -system-harfbuzz \ -system-libjpeg \ -system-libpng \ @@ -408,7 +397,6 @@ test -x configure || chmod +x configure %{?tds} \ %{?xkbcommon} \ -system-zlib \ - %{?use_gold_linker} \ -no-directfb make %{?_smp_mflags} @@ -865,6 +853,10 @@ fi %changelog +* Sun Dec 13 2015 Helio Chissini de Castro - 5.6.0-0.8 +- We're back to gold linker +- Remove reduce relocations + * Thu Dec 10 2015 Helio Chissini de Castro - 5.6.0-0.7 - Official beta release From d3ea11b3111d5effba753ac0f052e3c43af4caf9 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Mon, 14 Dec 2015 14:42:42 +0100 Subject: [PATCH 16/62] fix build failure on secondary arch --- qt5-qtbase.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index bbdc74c..976d1e7 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -27,7 +27,7 @@ # where qt5-qttools builds are not yet available # only primary archs (for now), allow secondary to bootstrap %if ! 0%{?bootstrap} -%ifarch %{arm} %{ix86} x86_64 +%ifarch %{arm} %{ix86} x86_64 ppc64le ppc64 s390 s390x %define docs 1 %endif %endif @@ -39,7 +39,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.10%{?dist} +Release: 0.11%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -857,6 +857,9 @@ fi %changelog +* Mon Dec 14 2015 Than Ngo - 5.6.0-0.11 +- fix build failure on secondary arch + * Sun Dec 13 2015 Helio Chissini de Castro - 5.6.0-0.10 - We're back to gold linker - Remove reduce relocations From 48a2c878aae6858a5e9cbf456514cb1579a9a9f6 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Mon, 14 Dec 2015 15:45:59 +0100 Subject: [PATCH 17/62] fix BR for s390 --- qt5-qtbase.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 976d1e7..364a378 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -170,7 +170,9 @@ BuildRequires: pkgconfig(xcb) pkgconfig(xcb-glx) pkgconfig(xcb-icccm) pkgconfig( BuildRequires: pkgconfig(zlib) # For the very first bootstrap of 5.6 we need valgring for now, as qt5-qdoc brand new # splitted package script still using it +%ifnarch s390 BuildRequires: valgrind +%endif %if 0%{?qtchooser} %if 0%{?fedora} From f3771ee0e5ac292920ea6ef75b3473697a81a373 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Wed, 16 Dec 2015 05:19:29 +0000 Subject: [PATCH 18/62] aarch64 is secondary arch too, ppc64le is NOT multilib, Fix Power 64 macro use --- qt5-qtbase.spec | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 364a378..8071d4c 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -1,6 +1,6 @@ # See http://bugzilla.redhat.com/223663 -%define multilib_archs x86_64 %{ix86} ppc64 ppc ppc64le s390x s390 sparc64 sparcv9 -%define multilib_basearchs x86_64 ppc64 s390x sparc64 ppc64le +%define multilib_archs x86_64 %{ix86} ppc64 ppc s390x s390 sparc64 sparcv9 +%define multilib_basearchs x86_64 ppc64 s390x sparc64 # support qtchooser (adds qtchooser .conf file) %define qtchooser 1 @@ -27,7 +27,7 @@ # where qt5-qttools builds are not yet available # only primary archs (for now), allow secondary to bootstrap %if ! 0%{?bootstrap} -%ifarch %{arm} %{ix86} x86_64 ppc64le ppc64 s390 s390x +%ifarch %{arm} %{ix86} x86_64 %{power64} s390 s390x aarch64 %define docs 1 %endif %endif @@ -39,7 +39,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.11%{?dist} +Release: 0.12%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -859,6 +859,11 @@ fi %changelog +* Wed Dec 16 2015 Peter Robinson 5.6.0-0.12 +- aarch64 is secondary arch too +- ppc64le is NOT multilib +- Fix Power 64 macro use + * Mon Dec 14 2015 Than Ngo - 5.6.0-0.11 - fix build failure on secondary arch From a3aafb481894043b73ac69db7a5950a188d236f9 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Wed, 16 Dec 2015 00:01:59 -0600 Subject: [PATCH 19/62] workaround moc/qconfig-multilib issues (#1290020,QTBUG-49972) --- qconfig-multilib.h | 3 +++ qt5-qtbase.spec | 11 ++++++++++- qtbase-opensource-src-5.6.0-moc_WORDSIZE.patch | 14 ++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 qtbase-opensource-src-5.6.0-moc_WORDSIZE.patch diff --git a/qconfig-multilib.h b/qconfig-multilib.h index 7ed351b..a104c37 100644 --- a/qconfig-multilib.h +++ b/qconfig-multilib.h @@ -6,7 +6,10 @@ #ifndef QCONFIG_MULTILIB_H #define QCONFIG_MULTILIB_H + +#ifndef __WORDSIZE #include +#endif #if __WORDSIZE == 32 #include "QtCore/qconfig-32.h" diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 8071d4c..d43e7ff 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -39,7 +39,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.12%{?dist} +Release: 0.13%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -73,6 +73,11 @@ Patch50: qt5-poll.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1083664 Patch51: qtbase-opensource-src-5.5-disconnect_displays.patch +# Workaround moc/multilib issues +# https://bugzilla.redhat.com/show_bug.cgi?id=1290020 +# https://bugreports.qt.io/browse/QTBUG-49972 +Patch52: qtbase-opensource-src-5.6.0-moc_WORDSIZE.patch + ## upstream patches # workaround https://bugreports.qt-project.org/browse/QTBUG-43057 # 'make docs' crash on el6, use qSort instead of std::sort @@ -316,6 +321,7 @@ rm -fv mkspecs/linux-g++*/qmake.conf.multilib-optflags %patch12 -p1 -b .enable_ft_lcdfilter #patch51 -p1 -b .disconnect_displays +%patch52 -p1 -b .moc_WORDSIZE %if 0%{?rhel} == 6 %patch100 -p1 -b .QTBUG-43057 @@ -859,6 +865,9 @@ fi %changelog +* Wed Dec 16 2015 Rex Dieter 5.6.0-0.13 +- workaround moc/qconfig-multilib issues (#1290020,QTBUG-49972) + * Wed Dec 16 2015 Peter Robinson 5.6.0-0.12 - aarch64 is secondary arch too - ppc64le is NOT multilib diff --git a/qtbase-opensource-src-5.6.0-moc_WORDSIZE.patch b/qtbase-opensource-src-5.6.0-moc_WORDSIZE.patch new file mode 100644 index 0000000..62d1e9c --- /dev/null +++ b/qtbase-opensource-src-5.6.0-moc_WORDSIZE.patch @@ -0,0 +1,14 @@ +diff -up qtbase-opensource-src-5.6.0-beta/src/tools/moc/main.cpp.moc_WORDSIZE qtbase-opensource-src-5.6.0-beta/src/tools/moc/main.cpp +--- qtbase-opensource-src-5.6.0-beta/src/tools/moc/main.cpp.moc_WORDSIZE 2015-12-04 18:05:24.000000000 -0600 ++++ qtbase-opensource-src-5.6.0-beta/src/tools/moc/main.cpp 2015-12-15 20:57:55.554485416 -0600 +@@ -184,6 +184,10 @@ int runMoc(int argc, char **argv) + Moc moc; + pp.macros["Q_MOC_RUN"]; + pp.macros["__cplusplus"]; ++ Macro macro; ++ macro.symbols = Preprocessor::tokenize(QByteArray::number(Q_PROCESSOR_WORDSIZE*8), 1, Preprocessor::TokenizeDefine); ++ macro.symbols.removeLast(); // remove the EOF symbol ++ pp.macros.insert("__WORDSIZE", macro); + + // Don't stumble over GCC extensions + Macro dummyVariadicFunctionMacro; From cd64dbe445558a71327adbbff60bb779e51811b7 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Wed, 16 Dec 2015 16:11:53 -0600 Subject: [PATCH 20/62] 5.6.0-0.15 - pull in another upstream moc fix/improvement (#1290020,QTBUG-49972) - fix bootstrap/docs --- ...tem-defines-from-the-compiler-itself.patch | 368 ++++++++++++++++++ qt5-qtbase.spec | 12 +- 2 files changed, 377 insertions(+), 3 deletions(-) create mode 100644 moc-get-the-system-defines-from-the-compiler-itself.patch diff --git a/moc-get-the-system-defines-from-the-compiler-itself.patch b/moc-get-the-system-defines-from-the-compiler-itself.patch new file mode 100644 index 0000000..cd8de49 --- /dev/null +++ b/moc-get-the-system-defines-from-the-compiler-itself.patch @@ -0,0 +1,368 @@ +From 7b2877325d398b28a3a99d29b7651a34c60237b1 Mon Sep 17 00:00:00 2001 +From: Thiago Macieira +Date: Fri, 21 Aug 2015 17:08:19 -0700 +Subject: [PATCH] moc: get the system #defines from the compiler itself + +In order for moc to properly parse #ifdefs and family, we've had +QMAKE_COMPILER_DEFINES as a list of pre-defined macros from the +compiler. That list is woefully incomplete. + +Instead, let's simply ask the compiler for the list. With GCC and +family, we use the -dM flag while preprocessing. With ICC on Windows, +the flag gains an extra "Q" but is otherwise the same. For MSVC, it +requires using some undocumented switches and parsing environment +variables (I've tested MSVC 2012, 2013 and 2015). + +The new moc option is called --include to be similar to GCC's -include +option. It does more than just parse a list of pre-defined macros and +can be used to insert any sort of code that moc needs to parse prior to +the main file. + +Change-Id: I7de033f80b0e4431b7f1ffff13fca02dbb60a0a6 +--- + mkspecs/features/moc.prf | 31 +++++++++++++-- + qmake/main.cpp | 38 +++++++++++++++++++ + src/tools/moc/main.cpp | 16 +++++++- + src/tools/moc/preprocessor.cpp | 60 +++++++++++++++++------------- + src/tools/moc/preprocessor.h | 1 + + tests/auto/tools/moc/subdir/extradefines.h | 1 + + tests/auto/tools/moc/tst_moc.cpp | 42 +++++++++++++++++++++ + 7 files changed, 158 insertions(+), 31 deletions(-) + create mode 100644 tests/auto/tools/moc/subdir/extradefines.h + +diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf +index c0b5682..159c659 100644 +--- a/mkspecs/features/moc.prf ++++ b/mkspecs/features/moc.prf +@@ -24,8 +24,25 @@ win32:count(MOC_INCLUDEPATH, 40, >) { + write_file($$absolute_path($$WIN_INCLUDETEMP, $$OUT_PWD), WIN_INCLUDETEMP_CONT)|error("Aborting.") + } + ++# QNX's compiler sets "gcc" config, but does not support the -dM option; ++# iOS builds are multi-arch, so this feature cannot possibly work. ++if(gcc|intel_icl|msvc):!rim_qcc:!ios { ++ moc_predefs.CONFIG = no_link ++ gcc: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -dM -E -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN} ++ else:intel_icl: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -QdM -P -Fi${QMAKE_FILE_OUT} ${QMAKE_FILE_IN} ++ else:msvc { ++ # make sure that our bin dir is first in path, so qmake is found ++ moc_predefs.commands = PATH $$shell_path($$[QT_INSTALL_BINS/src]);%PATH%& ++ moc_predefs.commands += $$QMAKE_CXX -Bxqmake $$QMAKE_CXXFLAGS -E ${QMAKE_FILE_IN} 2>NUL >${QMAKE_FILE_OUT} ++ } else: error("Oops, I messed up") ++ moc_predefs.output = $$MOC_DIR/moc_predefs.h ++ moc_predefs.input = MOC_PREDEF_FILE ++ silent: moc_predefs.commands = @echo generating $$moc_predefs.output$$escape_expand(\n\t)@$$moc_predefs.commands ++ QMAKE_EXTRA_COMPILERS += moc_predefs ++ MOC_PREDEF_FILE = $$[QT_INSTALL_ARCHDATA/src]/mkspecs/features/data/dummy.cpp ++} ++ + defineReplace(mocCmdBase) { +- RET = + !isEmpty(WIN_INCLUDETEMP) { + incvar = @$$WIN_INCLUDETEMP + } else { +@@ -34,7 +51,13 @@ defineReplace(mocCmdBase) { + incvar += -I$$shell_quote($$inc) + incvar += $$QMAKE_FRAMEWORKPATH_FLAGS + } +- RET += $$QMAKE_MOC $(DEFINES) $$join(QMAKE_COMPILER_DEFINES, " -D", -D) $$incvar $$QMAKE_MOC_OPTIONS ++ ++ RET = $$QMAKE_MOC $(DEFINES) ++ ++ isEmpty(MOC_PREDEF_FILE): RET += $$join(QMAKE_COMPILER_DEFINES, " -D", -D) ++ else: RET += --include $$moc_predefs.output ++ ++ RET += $$incvar $$QMAKE_MOC_OPTIONS + return($$RET) + } + +@@ -46,7 +69,7 @@ moc_header.output = $$MOC_DIR/$${QMAKE_H_MOD_MOC}${QMAKE_FILE_BASE}$${first(QMAK + moc_header.input = HEADERS + moc_header.variable_out = SOURCES + moc_header.name = MOC ${QMAKE_FILE_IN} +-moc_header.depends += $$WIN_INCLUDETEMP ++moc_header.depends += $$WIN_INCLUDETEMP $$moc_predefs.output + silent:moc_header.commands = @echo moc ${QMAKE_FILE_IN} && $$moc_header.commands + QMAKE_EXTRA_COMPILERS += moc_header + INCREDIBUILD_XGE += moc_header +@@ -58,7 +81,7 @@ moc_source.commands = ${QMAKE_FUNC_mocCmdBase} ${QMAKE_FILE_IN} -o ${QMAKE_FILE_ + moc_source.output = $$MOC_DIR/$${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_EXT_CPP_MOC} + moc_source.input = SOURCES OBJECTIVE_SOURCES + moc_source.name = MOC ${QMAKE_FILE_IN} +-moc_source.depends += $$WIN_INCLUDETEMP ++moc_source.depends += $$WIN_INCLUDETEMP $$moc_predefs.output + silent:moc_source.commands = @echo moc ${QMAKE_FILE_IN} && $$moc_source.commands + QMAKE_EXTRA_COMPILERS += moc_source + INCREDIBUILD_XGE += moc_source +diff --git a/qmake/main.cpp b/qmake/main.cpp +index bde537d..e9b8bde 100644 +--- a/qmake/main.cpp ++++ b/qmake/main.cpp +@@ -1,6 +1,7 @@ + /**************************************************************************** + ** + ** Copyright (C) 2015 The Qt Company Ltd. ++** Copyright (C) 2015 Intel Corporation. + ** Contact: http://www.qt.io/licensing/ + ** + ** This file is part of the qmake application of the Qt Toolkit. +@@ -47,6 +48,10 @@ + #include + #include + ++#ifdef Q_OS_WIN ++# include ++#endif ++ + QT_BEGIN_NAMESPACE + + #ifdef Q_OS_WIN +@@ -246,6 +251,30 @@ static int doInstall(int argc, char **argv) + return 3; + } + ++static int dumpMacros(const wchar_t *cmdline) ++{ ++ // from http://stackoverflow.com/questions/3665537/how-to-find-out-cl-exes-built-in-macros ++ int argc; ++ wchar_t **argv = CommandLineToArgvW(cmdline, &argc); ++ if (!argv) ++ return 2; ++ for (int i = 0; i < argc; ++i) { ++ if (argv[i][0] != L'-' || argv[i][1] != 'D') ++ continue; ++ ++ wchar_t *value = wcschr(argv[i], L'='); ++ if (value) { ++ *value = 0; ++ ++value; ++ } else { ++ // point to the NUL at the end, so we don't print anything ++ value = argv[i] + wcslen(argv[i]); ++ } ++ wprintf(L"#define %Ls %Ls\n", argv[i] + 2, value); ++ } ++ return 0; ++} ++ + #endif // Q_OS_WIN + + /* This is to work around lame implementation on Darwin. It has been noted that the getpwd(3) function +@@ -280,6 +309,15 @@ int runQMake(int argc, char **argv) + // Workaround for inferior/missing command line tools on Windows: make our own! + if (argc >= 2 && !strcmp(argv[1], "-install")) + return doInstall(argc - 2, argv + 2); ++ ++ { ++ // Support running as Visual C++'s compiler ++ const wchar_t *cmdline = _wgetenv(L"MSC_CMD_FLAGS"); ++ if (!cmdline || !*cmdline) ++ cmdline = _wgetenv(L"MSC_IDE_FLAGS"); ++ if (cmdline && *cmdline) ++ return dumpMacros(cmdline); ++ } + #endif + + QMakeVfs vfs; +diff --git a/src/tools/moc/main.cpp b/src/tools/moc/main.cpp +index a5cbad7..d06335d 100644 +--- a/src/tools/moc/main.cpp ++++ b/src/tools/moc/main.cpp +@@ -259,6 +259,11 @@ int runMoc(int argc, char **argv) + prependIncludeOption.setValueName(QStringLiteral("file")); + parser.addOption(prependIncludeOption); + ++ QCommandLineOption includeOption(QStringLiteral("include")); ++ includeOption.setDescription(QStringLiteral("Parse as an #include before the main source(s).")); ++ includeOption.setValueName(QStringLiteral("file")); ++ parser.addOption(includeOption); ++ + QCommandLineOption noNotesWarningsCompatOption(QStringLiteral("n")); + noNotesWarningsCompatOption.setDescription(QStringLiteral("Do not display notes (-nn) or warnings (-nw). Compatibility option.")); + noNotesWarningsCompatOption.setValueName(QStringLiteral("which")); +@@ -406,7 +411,16 @@ int runMoc(int argc, char **argv) + moc.includes = pp.includes; + + // 1. preprocess +- moc.symbols = pp.preprocessed(moc.filename, &in); ++ foreach (const QString &includeName, parser.values(includeOption)) { ++ QByteArray rawName = pp.resolveInclude(QFile::encodeName(includeName), moc.filename); ++ QFile f(QFile::decodeName(rawName)); ++ if (f.open(QIODevice::ReadOnly)) { ++ moc.symbols += Symbol(0, MOC_INCLUDE_BEGIN, rawName); ++ moc.symbols += pp.preprocessed(rawName, &f); ++ moc.symbols += Symbol(0, MOC_INCLUDE_END, rawName); ++ } ++ } ++ moc.symbols += pp.preprocessed(moc.filename, &in); + + if (!pp.preprocessOnly) { + // 2. parse +diff --git a/src/tools/moc/preprocessor.cpp b/src/tools/moc/preprocessor.cpp +index d036c40..70cf14a 100644 +--- a/src/tools/moc/preprocessor.cpp ++++ b/src/tools/moc/preprocessor.cpp +@@ -1001,6 +1001,37 @@ static void mergeStringLiterals(Symbols *_symbols) + } + } + ++QByteArray Preprocessor::resolveInclude(const QByteArray &include, const QByteArray &relativeTo) ++{ ++ // #### stringery ++ QFileInfo fi; ++ if (!relativeTo.isEmpty()) ++ fi.setFile(QFileInfo(QString::fromLocal8Bit(relativeTo.constData())).dir(), QString::fromLocal8Bit(include.constData())); ++ for (int j = 0; j < Preprocessor::includes.size() && !fi.exists(); ++j) { ++ const IncludePath &p = Preprocessor::includes.at(j); ++ if (p.isFrameworkPath) { ++ const int slashPos = include.indexOf('/'); ++ if (slashPos == -1) ++ continue; ++ QByteArray frameworkCandidate = include.left(slashPos); ++ frameworkCandidate.append(".framework/Headers/"); ++ fi.setFile(QString::fromLocal8Bit(QByteArray(p.path + '/' + frameworkCandidate).constData()), QString::fromLocal8Bit(include.mid(slashPos + 1).constData())); ++ } else { ++ fi.setFile(QString::fromLocal8Bit(p.path.constData()), QString::fromLocal8Bit(include.constData())); ++ } ++ // try again, maybe there's a file later in the include paths with the same name ++ // (186067) ++ if (fi.isDir()) { ++ fi = QFileInfo(); ++ continue; ++ } ++ } ++ ++ if (!fi.exists() || fi.isDir()) ++ return QByteArray(); ++ return fi.canonicalFilePath().toLocal8Bit(); ++} ++ + void Preprocessor::preprocess(const QByteArray &filename, Symbols &preprocessed) + { + currentFilenames.push(filename); +@@ -1021,33 +1052,9 @@ void Preprocessor::preprocess(const QByteArray &filename, Symbols &preprocessed) + continue; + until(PP_NEWLINE); + +- // #### stringery +- QFileInfo fi; +- if (local) +- fi.setFile(QFileInfo(QString::fromLocal8Bit(filename.constData())).dir(), QString::fromLocal8Bit(include.constData())); +- for (int j = 0; j < Preprocessor::includes.size() && !fi.exists(); ++j) { +- const IncludePath &p = Preprocessor::includes.at(j); +- if (p.isFrameworkPath) { +- const int slashPos = include.indexOf('/'); +- if (slashPos == -1) +- continue; +- QByteArray frameworkCandidate = include.left(slashPos); +- frameworkCandidate.append(".framework/Headers/"); +- fi.setFile(QString::fromLocal8Bit(QByteArray(p.path + '/' + frameworkCandidate).constData()), QString::fromLocal8Bit(include.mid(slashPos + 1).constData())); +- } else { +- fi.setFile(QString::fromLocal8Bit(p.path.constData()), QString::fromLocal8Bit(include.constData())); +- } +- // try again, maybe there's a file later in the include paths with the same name +- // (186067) +- if (fi.isDir()) { +- fi = QFileInfo(); +- continue; +- } +- } +- +- if (!fi.exists() || fi.isDir()) ++ include = resolveInclude(include, local ? filename : QByteArray()); ++ if (include.isNull()) + continue; +- include = fi.canonicalFilePath().toLocal8Bit(); + + if (Preprocessor::preprocessedIncludes.contains(include)) + continue; +@@ -1202,6 +1209,7 @@ Symbols Preprocessor::preprocessed(const QByteArray &filename, QFile *file) + input = cleaned(input); + + // phase 2: tokenize for the preprocessor ++ index = 0; + symbols = tokenize(input); + + #if 0 +diff --git a/src/tools/moc/preprocessor.h b/src/tools/moc/preprocessor.h +index 9c81f86..d876caf 100644 +--- a/src/tools/moc/preprocessor.h ++++ b/src/tools/moc/preprocessor.h +@@ -67,6 +67,7 @@ public: + QList frameworks; + QSet preprocessedIncludes; + Macros macros; ++ QByteArray resolveInclude(const QByteArray &filename, const QByteArray &relativeTo); + Symbols preprocessed(const QByteArray &filename, QFile *device); + + void parseDefineArguments(Macro *m); +diff --git a/tests/auto/tools/moc/subdir/extradefines.h b/tests/auto/tools/moc/subdir/extradefines.h +new file mode 100644 +index 0000000..e7888ce +--- /dev/null ++++ b/tests/auto/tools/moc/subdir/extradefines.h +@@ -0,0 +1 @@ ++#define FOO 1 +diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp +index fa1b68b..1d6a911 100644 +--- a/tests/auto/tools/moc/tst_moc.cpp ++++ b/tests/auto/tools/moc/tst_moc.cpp +@@ -552,6 +552,8 @@ private slots: + void frameworkSearchPath(); + void cstyleEnums(); + void defineMacroViaCmdline(); ++ void defineMacroViaForcedInclude(); ++ void defineMacroViaForcedIncludeRelative(); + void specifyMetaTagsFromCmdline(); + void invokable(); + void singleFunctionKeywordSignalAndSlot(); +@@ -1219,6 +1221,46 @@ void tst_Moc::defineMacroViaCmdline() + #endif + } + ++void tst_Moc::defineMacroViaForcedInclude() ++{ ++#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS) ++ QProcess proc; ++ ++ QStringList args; ++ args << "--include" << m_sourceDirectory + QLatin1String("/subdir/extradefines.h"); ++ args << m_sourceDirectory + QStringLiteral("/macro-on-cmdline.h"); ++ ++ proc.start(m_moc, args); ++ QVERIFY(proc.waitForFinished()); ++ QCOMPARE(proc.exitCode(), 0); ++ QCOMPARE(proc.readAllStandardError(), QByteArray()); ++ QByteArray mocOut = proc.readAllStandardOutput(); ++ QVERIFY(!mocOut.isEmpty()); ++#else ++ QSKIP("Only tested on linux/gcc"); ++#endif ++} ++ ++void tst_Moc::defineMacroViaForcedIncludeRelative() ++{ ++#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS) ++ QProcess proc; ++ ++ QStringList args; ++ args << "--include" << QStringLiteral("extradefines.h") << "-I" + m_sourceDirectory + "/subdir"; ++ args << m_sourceDirectory + QStringLiteral("/macro-on-cmdline.h"); ++ ++ proc.start(m_moc, args); ++ QVERIFY(proc.waitForFinished()); ++ QCOMPARE(proc.exitCode(), 0); ++ QCOMPARE(proc.readAllStandardError(), QByteArray()); ++ QByteArray mocOut = proc.readAllStandardOutput(); ++ QVERIFY(!mocOut.isEmpty()); ++#else ++ QSKIP("Only tested on linux/gcc"); ++#endif ++} ++ + // tst_Moc::specifyMetaTagsFromCmdline() + // plugin_metadata.h contains a plugin which we register here. Since we're not building this + // application as a plugin, we need top copy some of the initializer code found in qplugin.h: +-- +1.9.3 + diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index d43e7ff..27ca285 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -39,7 +39,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.13%{?dist} +Release: 0.15%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -88,6 +88,9 @@ Patch102: 0002-xcb-compare-to-previous-state-when-sending-geometry-.patch Patch111: 0011-xcb-Don-t-cache-the-screen-for-a-window.patch Patch112: 0012-xcb-Use-a-placeholder-QScreen-when-there-are-no-outp.patch +# recently passed code review, not integrated yet +Patch150: moc-get-the-system-defines-from-the-compiler-itself.patch + # macros, be mindful to keep sync'd with macros.qt5 Source10: macros.qt5 %define _qt5 %{name} @@ -331,6 +334,7 @@ rm -fv mkspecs/linux-g++*/qmake.conf.multilib-optflags %patch102 -p1 -b .0002 %patch111 -p1 -b .0011 %patch112 -p1 -b .0012 +%patch150 -p1 -b .moc_system_defines # drop -fexceptions from $RPM_OPT_FLAGS RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's|-fexceptions||g'` @@ -602,10 +606,8 @@ fi %dir %{_qt5_libdir}/cmake/Qt5Test/ %dir %{_qt5_libdir}/cmake/Qt5Widgets/ %dir %{_qt5_libdir}/cmake/Qt5Xml/ -%if 0%{?docs} %dir %{_qt5_docdir}/ %{_qt5_docdir}/global/ -%endif %{_qt5_importdir}/ %{_qt5_translationdir}/ %dir %{_qt5_prefix}/ @@ -865,6 +867,10 @@ fi %changelog +* Wed Dec 16 2015 Rex Dieter - 5.6.0-0.15 +- pull in another upstream moc fix/improvement (#1290020,QTBUG-49972) +- fix bootstrap/docs + * Wed Dec 16 2015 Rex Dieter 5.6.0-0.13 - workaround moc/qconfig-multilib issues (#1290020,QTBUG-49972) From 63a3e5d5ec5192d97e3cb6c04132b4662e247abc Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Thu, 17 Dec 2015 09:28:24 -0600 Subject: [PATCH 21/62] add upstream reference for new patch --- qt5-qtbase.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 27ca285..b5b04b7 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -89,6 +89,7 @@ Patch111: 0011-xcb-Don-t-cache-the-screen-for-a-window.patch Patch112: 0012-xcb-Use-a-placeholder-QScreen-when-there-are-no-outp.patch # recently passed code review, not integrated yet +# https://codereview.qt-project.org/126102/ Patch150: moc-get-the-system-defines-from-the-compiler-itself.patch # macros, be mindful to keep sync'd with macros.qt5 From 87950aa1a5cde0c0b77a2f6369e711a35f26472f Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Fri, 18 Dec 2015 09:17:43 -0600 Subject: [PATCH 22/62] refresh moc patch --- moc-get-the-system-defines-from-the-compiler-itself.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/moc-get-the-system-defines-from-the-compiler-itself.patch b/moc-get-the-system-defines-from-the-compiler-itself.patch index cd8de49..3912cc7 100644 --- a/moc-get-the-system-defines-from-the-compiler-itself.patch +++ b/moc-get-the-system-defines-from-the-compiler-itself.patch @@ -1,4 +1,4 @@ -From 7b2877325d398b28a3a99d29b7651a34c60237b1 Mon Sep 17 00:00:00 2001 +From fa0d02eedcacc22db1026b902801b29176755362 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 21 Aug 2015 17:08:19 -0700 Subject: [PATCH] moc: get the system #defines from the compiler itself @@ -31,7 +31,7 @@ Change-Id: I7de033f80b0e4431b7f1ffff13fca02dbb60a0a6 create mode 100644 tests/auto/tools/moc/subdir/extradefines.h diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf -index c0b5682..159c659 100644 +index c0b5682..af885c3 100644 --- a/mkspecs/features/moc.prf +++ b/mkspecs/features/moc.prf @@ -24,8 +24,25 @@ win32:count(MOC_INCLUDEPATH, 40, >) { @@ -53,7 +53,7 @@ index c0b5682..159c659 100644 + moc_predefs.input = MOC_PREDEF_FILE + silent: moc_predefs.commands = @echo generating $$moc_predefs.output$$escape_expand(\n\t)@$$moc_predefs.commands + QMAKE_EXTRA_COMPILERS += moc_predefs -+ MOC_PREDEF_FILE = $$[QT_INSTALL_ARCHDATA/src]/mkspecs/features/data/dummy.cpp ++ MOC_PREDEF_FILE = $$[QT_HOST_DATA/src]/mkspecs/features/data/dummy.cpp +} + defineReplace(mocCmdBase) { From 62968e5566195515edd84e8f53bee51481ee0b07 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Fri, 18 Dec 2015 09:31:42 -0600 Subject: [PATCH 23/62] 5.6.0-beta (final) --- .gitignore | 1 - 0001-XCB-prevent-a-fp-division-by-zero.patch | 58 -- ...revious-state-when-sending-geometry-.patch | 86 --- ...-Don-t-cache-the-screen-for-a-window.patch | 116 --- ...older-QScreen-when-there-are-no-outp.patch | 721 ------------------ qt5-qtbase-QTBUG-47041.patch | 45 -- qt5-qtbase.spec | 18 +- ...ensource-src-5.6.0-xcb-gerrit-138201.patch | 704 ----------------- sources | 2 +- 9 files changed, 9 insertions(+), 1742 deletions(-) delete mode 100644 0001-XCB-prevent-a-fp-division-by-zero.patch delete mode 100644 0002-xcb-compare-to-previous-state-when-sending-geometry-.patch delete mode 100644 0011-xcb-Don-t-cache-the-screen-for-a-window.patch delete mode 100644 0012-xcb-Use-a-placeholder-QScreen-when-there-are-no-outp.patch delete mode 100644 qt5-qtbase-QTBUG-47041.patch delete mode 100644 qtbase-opensource-src-5.6.0-xcb-gerrit-138201.patch diff --git a/.gitignore b/.gitignore index 6202538..d1fab2c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ /qtbase-opensource-src-5.5.1.tar.xz -/qtbase-opensource-src-5.6.0-beta2.tar.xz /qtbase-opensource-src-5.6.0-beta.tar.gz diff --git a/0001-XCB-prevent-a-fp-division-by-zero.patch b/0001-XCB-prevent-a-fp-division-by-zero.patch deleted file mode 100644 index 9a186ab..0000000 --- a/0001-XCB-prevent-a-fp-division-by-zero.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 40c927e7331ea4ac9ca50de48560b700e657cded Mon Sep 17 00:00:00 2001 -From: Giuseppe D'Angelo -Date: Tue, 8 Dec 2015 18:28:24 +0100 -Subject: [PATCH 01/12] XCB: prevent a fp division by zero -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -For certain devices vci->resolution is zero, which causes a SIGFPE -if FE_INVALID exceptions are enabled. Try to prevent that. - -Task-number: QTBUG-42717 -Change-Id: I388735f5dfb6218496787dbb74cf0c0f43cc928f -Reviewed-by: Alexander Volkov -Reviewed-by: Błażej Szczygieł -Reviewed-by: Shawn Rutledge ---- - src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 11 +++++++---- - 1 file changed, 7 insertions(+), 4 deletions(-) - -diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp -index 8097cce..1a12370 100644 ---- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp -+++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp -@@ -406,6 +406,9 @@ XInput2TouchDeviceData *QXcbConnection::touchDeviceForId(int id) - #endif // XCB_USE_XINPUT22 - case XIValuatorClass: { - XIValuatorClassInfo *vci = reinterpret_cast(classinfo); -+ // Some devices (mice) report a resolution of 0; they will be excluded later, -+ // for now just prevent a division by zero -+ const int vciResolution = vci->resolution ? vci->resolution : 1; - if (vci->label == atom(QXcbAtom::AbsMTPositionX)) - caps |= QTouchDevice::Position | QTouchDevice::NormalizedPosition; - else if (vci->label == atom(QXcbAtom::AbsMTTouchMajor)) -@@ -414,16 +417,16 @@ XInput2TouchDeviceData *QXcbConnection::touchDeviceForId(int id) - caps |= QTouchDevice::Pressure; - else if (vci->label == atom(QXcbAtom::RelX)) { - hasRelativeCoords = true; -- dev->size.setWidth((vci->max - vci->min) * 1000.0 / vci->resolution); -+ dev->size.setWidth((vci->max - vci->min) * 1000.0 / vciResolution); - } else if (vci->label == atom(QXcbAtom::RelY)) { - hasRelativeCoords = true; -- dev->size.setHeight((vci->max - vci->min) * 1000.0 / vci->resolution); -+ dev->size.setHeight((vci->max - vci->min) * 1000.0 / vciResolution); - } else if (vci->label == atom(QXcbAtom::AbsX)) { - caps |= QTouchDevice::Position; -- dev->size.setHeight((vci->max - vci->min) * 1000.0 / vci->resolution); -+ dev->size.setHeight((vci->max - vci->min) * 1000.0 / vciResolution); - } else if (vci->label == atom(QXcbAtom::AbsY)) { - caps |= QTouchDevice::Position; -- dev->size.setWidth((vci->max - vci->min) * 1000.0 / vci->resolution); -+ dev->size.setWidth((vci->max - vci->min) * 1000.0 / vciResolution); - } - break; - } --- -2.5.0 - diff --git a/0002-xcb-compare-to-previous-state-when-sending-geometry-.patch b/0002-xcb-compare-to-previous-state-when-sending-geometry-.patch deleted file mode 100644 index 2c74c52..0000000 --- a/0002-xcb-compare-to-previous-state-when-sending-geometry-.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 56f6252e7285c9c61a99416fa2a8571fd67c597f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= - -Date: Tue, 1 Dec 2015 16:27:09 +0100 -Subject: [PATCH 02/12] xcb: compare to previous state when sending geometry - and expose events -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -By calculating the previous geometry and passing it on when calling -handleGeometryChange we can detect cases where setGeometry() on a -QWindow didn't result in the expected geometry. The new (actual) -geometry is delivered as a resize event. - -This also allows us to only send expose events when the size of the -window has actually changed (instead of also sending when the window -has just moved). - -Due to the async delivery of geometry changes on the xcb platform we -need to avoid using QWindowPrivate's cached state of the geometry, as -that will result in duplicate resize events when events are not flushed -in between two system resize events coming in with the same size. - -Change-Id: I3d4abe4a1095dd96e6e354288d5b646c623c30dd -Reviewed-by: Tor Arne Vestbø ---- - src/plugins/platforms/xcb/qxcbwindow.cpp | 33 ++++++++++++++++++++++++++------ - 1 file changed, 27 insertions(+), 6 deletions(-) - -diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp -index 6023ee6..98bcc62 100644 ---- a/src/plugins/platforms/xcb/qxcbwindow.cpp -+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp -@@ -2007,21 +2007,42 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t * - } - } - -- const QRect rect = QRect(pos, QSize(event->width, event->height)); -- QPlatformScreen *newScreen = parent() ? parent()->screen() : screenForGeometry(rect); -+ // The original geometry requested by setGeometry() might be different -+ // from what we end up with after applying window constraints. -+ QRect requestedGeometry = geometry(); -+ -+ const QRect actualGeometry = QRect(pos, QSize(event->width, event->height)); -+ QPlatformScreen *newScreen = parent() ? parent()->screen() : screenForGeometry(actualGeometry); - - QXcbScreen *currentScreen = m_xcbScreen; - m_xcbScreen = static_cast(newScreen); - if (!newScreen) - return; - -- QPlatformWindow::setGeometry(rect); -- QWindowSystemInterface::handleGeometryChange(window(), rect); -+ // Persist the actual geometry so that QWindow::geometry() can -+ // be queried in the resize event. -+ QPlatformWindow::setGeometry(actualGeometry); -+ -+ // As we're delivering the geometry change through QPA in n async fashion we can't -+ // pass on the current geometry of the QWindowPrivate, as that may have not been -+ // updated yet by a geometry change that's still in the QPA event queue. Instead -+ // we fall back to the default argument value of QRect(), which will result in -+ // QGuiApplication looking up the previous geometry from QWindowPrivate, but this -+ // time in sync with the even delivery/processing. -+ QWindowSystemInterface::handleGeometryChange(window(), actualGeometry, -+ requestedGeometry != actualGeometry ? requestedGeometry : QRect()); -+ - if (newScreen != currentScreen) - QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen()); - -- if (m_mapped) -- QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size())); -+ // For expose events we have no way of telling QGuiApplication to used the locally -+ // cached version of the previous state, so we may in some situations end up with -+ // an additional expose event. -+ QRect previousGeometry = requestedGeometry != actualGeometry ? -+ requestedGeometry : qt_window_private(window())->geometry; -+ -+ if (m_mapped && actualGeometry.size() != previousGeometry.size()) -+ QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), actualGeometry.size())); - - if (m_usingSyncProtocol && m_syncState == SyncReceived) - m_syncState = SyncAndConfigureReceived; --- -2.5.0 - diff --git a/0011-xcb-Don-t-cache-the-screen-for-a-window.patch b/0011-xcb-Don-t-cache-the-screen-for-a-window.patch deleted file mode 100644 index fdd795e..0000000 --- a/0011-xcb-Don-t-cache-the-screen-for-a-window.patch +++ /dev/null @@ -1,116 +0,0 @@ -From 0c33a823c560bdf18a513ae460eea4d7bdf9e115 Mon Sep 17 00:00:00 2001 -From: Alexander Volkov -Date: Tue, 24 Nov 2015 15:09:41 +0300 -Subject: [PATCH 11/12] xcb: Don't cache the screen for a window -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -QXcbWindow::m_xcbScreen was introduced in 4e1b09fa8ff1a9ab42c0a29a2efe1ae7f4700d71 -(Keep screen geometries from overlapping) to map the window -geometry for the right screen, because it wasn't possible to -rely on QPlatformWindow::screen(). - -But we don't need it since a705b4ec1f6f7133390054f8b6b8077ef0550311 -(Introduce cross platform high-dpi scaling), because QGuiApplication -triggers GeometryChangeEvent right after processing WindowScreenChangedEvent. - -So just use QPlatformWindow::screen() instead of cached m_xcbScreen. - -m_xcbScreen was also used in d4bc56cb4218f6f8378f04c23865156b349b037d -(Fix screen detection on configureNotify) to compare the new screen -after receiving ConfigureNotify to the correct old screen. Just send -WindowScreenChangedEvent event and leave making the comparison to -QGuiApplication. - -Change-Id: Ibe717ae4bf4c40b0a04cd62fe2ecaee5df5f4060 -Reviewed-by: Błażej Szczygieł -Reviewed-by: Shawn Rutledge ---- - src/plugins/platforms/xcb/qxcbwindow.cpp | 16 ++++++---------- - src/plugins/platforms/xcb/qxcbwindow.h | 2 -- - 2 files changed, 6 insertions(+), 12 deletions(-) - -diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp -index 98bcc62..6add0a6 100644 ---- a/src/plugins/platforms/xcb/qxcbwindow.cpp -+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp -@@ -143,7 +143,7 @@ const quint32 XEMBED_VERSION = 0; - - QXcbScreen *QXcbWindow::parentScreen() - { -- return parent() ? static_cast(parent())->parentScreen() : m_xcbScreen; -+ return parent() ? static_cast(parent())->parentScreen() : xcbScreen(); - } - - // Returns \c true if we should set WM_TRANSIENT_FOR on \a w -@@ -266,7 +266,6 @@ static const char *wm_window_type_property_id = "_q_xcb_wm_window_type"; - QXcbWindow::QXcbWindow(QWindow *window) - : QPlatformWindow(window) - , m_window(0) -- , m_xcbScreen(0) - , m_syncCounter(0) - , m_gravity(XCB_GRAVITY_STATIC) - , m_mapped(false) -@@ -322,7 +321,6 @@ void QXcbWindow::create() - QRect rect = windowGeometry(); - QXcbScreen *platformScreen = parent() ? parentScreen() : static_cast(screenForGeometry(rect)); - -- m_xcbScreen = platformScreen; - if (type == Qt::Desktop) { - m_window = platformScreen->root(); - m_depth = platformScreen->screen()->root_depth; -@@ -638,13 +636,12 @@ void QXcbWindow::setGeometry(const QRect &rect) - - propagateSizeHints(); - -- QXcbScreen *currentScreen = m_xcbScreen; -+ QXcbScreen *currentScreen = xcbScreen(); - QXcbScreen *newScreen = parent() ? parentScreen() : static_cast(screenForGeometry(rect)); - - if (!newScreen) - newScreen = xcbScreen(); - -- m_xcbScreen = newScreen; - const QRect wmGeometry = windowToWmGeometry(rect); - - if (newScreen && newScreen != currentScreen) -@@ -2013,9 +2010,6 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t * - - const QRect actualGeometry = QRect(pos, QSize(event->width, event->height)); - QPlatformScreen *newScreen = parent() ? parent()->screen() : screenForGeometry(actualGeometry); -- -- QXcbScreen *currentScreen = m_xcbScreen; -- m_xcbScreen = static_cast(newScreen); - if (!newScreen) - return; - -@@ -2032,8 +2026,10 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t * - QWindowSystemInterface::handleGeometryChange(window(), actualGeometry, - requestedGeometry != actualGeometry ? requestedGeometry : QRect()); - -- if (newScreen != currentScreen) -- QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen()); -+ // QPlatformScreen::screen() is updated asynchronously, so we can't compare it -+ // with the newScreen. Just send the WindowScreenChanged event and QGuiApplication -+ // will make the comparison later. -+ QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen()); - - // For expose events we have no way of telling QGuiApplication to used the locally - // cached version of the previous state, so we may in some situations end up with -diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h -index 43e66a7..0d14673 100644 ---- a/src/plugins/platforms/xcb/qxcbwindow.h -+++ b/src/plugins/platforms/xcb/qxcbwindow.h -@@ -214,8 +214,6 @@ protected: - - xcb_window_t m_window; - -- QXcbScreen *m_xcbScreen; -- - uint m_depth; - QImage::Format m_imageFormat; - bool m_imageRgbSwap; --- -2.5.0 - diff --git a/0012-xcb-Use-a-placeholder-QScreen-when-there-are-no-outp.patch b/0012-xcb-Use-a-placeholder-QScreen-when-there-are-no-outp.patch deleted file mode 100644 index 665827e..0000000 --- a/0012-xcb-Use-a-placeholder-QScreen-when-there-are-no-outp.patch +++ /dev/null @@ -1,721 +0,0 @@ -From a094af001795c9651b299d700a992150d1aba33a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= -Date: Fri, 16 Oct 2015 22:51:59 +0200 -Subject: [PATCH 12/12] xcb: Use a placeholder QScreen when there are no - outputs connected - -If no screens are available, windows could disappear, could stop rendering -graphics, or the application could crash. This is a real use case in several -scenarios: with x11vnc, when all monitors are physically disconnected from a -desktop machine, or in some cases even when the monitor sleeps. Now when the -last screen is disconnected, it is transformed into a fake screen. When a -physical screen appears, the fake QScreen is transformed into a representation -of the physical screen. Every virtual desktop has its own fake screen, and -primary screens must belong to the primary virtual desktop. It fixes updating -screen geometry on temporarily disabled screens in the middle of the mode -switch. - -Expected results: Windows don't disappear, the application doesn't -crash, and QMenu is displayed on the appropriate screen. - -This reverts patch 51ada7734ad780178ecced11e0dff454dfc2e5f2 - -Change-Id: I6e8eb682b0c8425d08ffdaecbd4c6c7700c914b4 -Task-number: QTBUG-42985 -Reviewed-by: Shawn Rutledge ---- - src/gui/kernel/qscreen.cpp | 4 +- - src/plugins/platforms/xcb/qxcbconnection.cpp | 273 +++++++++++++++------------ - src/plugins/platforms/xcb/qxcbconnection.h | 10 +- - src/plugins/platforms/xcb/qxcbscreen.cpp | 49 +++-- - src/plugins/platforms/xcb/qxcbscreen.h | 10 +- - src/plugins/platforms/xcb/qxcbwindow.cpp | 38 +--- - src/plugins/platforms/xcb/qxcbwindow.h | 1 - - 7 files changed, 212 insertions(+), 173 deletions(-) - -diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp -index fb322ae..52e7686 100644 ---- a/src/gui/kernel/qscreen.cpp -+++ b/src/gui/kernel/qscreen.cpp -@@ -116,8 +116,8 @@ QScreen::~QScreen() - bool movingFromVirtualSibling = primaryScreen && primaryScreen->handle()->virtualSiblings().contains(handle()); - - // Move any leftover windows to the primary screen -- foreach (QWindow *window, QGuiApplication::topLevelWindows()) { -- if (window->screen() != this) -+ foreach (QWindow *window, QGuiApplication::allWindows()) { -+ if (!window->isTopLevel() || window->screen() != this) - continue; - - const bool wasVisible = window->isVisible(); -diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp -index 50d49ca..231fe9a 100644 ---- a/src/plugins/platforms/xcb/qxcbconnection.cpp -+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp -@@ -179,42 +179,6 @@ QXcbScreen* QXcbConnection::findScreenForOutput(xcb_window_t rootWindow, xcb_ran - return 0; - } - --QXcbScreen* QXcbConnection::createScreen(QXcbVirtualDesktop* virtualDesktop, -- xcb_randr_output_t outputId, -- xcb_randr_get_output_info_reply_t *output) --{ -- QString name; -- if (output) -- name = QString::fromUtf8((const char*)xcb_randr_get_output_info_name(output), -- xcb_randr_get_output_info_name_length(output)); -- else { -- QByteArray displayName = m_displayName; -- int dotPos = displayName.lastIndexOf('.'); -- if (dotPos != -1) -- displayName.truncate(dotPos); -- name = QString::fromLocal8Bit(displayName) + QLatin1Char('.') + QString::number(virtualDesktop->number()); -- } -- -- return new QXcbScreen(this, virtualDesktop, outputId, output, name); --} -- --bool QXcbConnection::checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output) --{ -- xcb_generic_error_t *error = 0; -- xcb_randr_get_output_primary_cookie_t primaryCookie = -- xcb_randr_get_output_primary(xcb_connection(), rootWindow); -- QScopedPointer primary ( -- xcb_randr_get_output_primary_reply(xcb_connection(), primaryCookie, &error)); -- if (!primary || error) { -- qWarning("failed to get the primary output of the screen"); -- free(error); -- error = NULL; -- } -- const bool isPrimary = primary ? (primary->output == output) : false; -- -- return isPrimary; --} -- - QXcbVirtualDesktop* QXcbConnection::virtualDesktopForRootWindow(xcb_window_t rootWindow) - { - foreach (QXcbVirtualDesktop *virtualDesktop, m_virtualDesktops) { -@@ -237,8 +201,9 @@ void QXcbConnection::updateScreens(const xcb_randr_notify_event_t *event) - // Not for us - return; - -- qCDebug(lcQpaScreen) << "QXcbConnection: XCB_RANDR_NOTIFY_CRTC_CHANGE:" << crtc.crtc; - QXcbScreen *screen = findScreenForCrtc(crtc.window, crtc.crtc); -+ qCDebug(lcQpaScreen) << "QXcbConnection: XCB_RANDR_NOTIFY_CRTC_CHANGE:" << crtc.crtc -+ << "mode" << crtc.mode << "relevant screen" << screen; - // Only update geometry when there's a valid mode on the CRTC - // CRTC with node mode could mean that output has been disabled, and we'll - // get RRNotifyOutputChange notification for that. -@@ -260,16 +225,7 @@ void QXcbConnection::updateScreens(const xcb_randr_notify_event_t *event) - - if (screen && output.connection == XCB_RANDR_CONNECTION_DISCONNECTED) { - qCDebug(lcQpaScreen) << "screen" << screen->name() << "has been disconnected"; -- -- // Known screen removed -> delete it -- m_screens.removeOne(screen); -- virtualDesktop->removeScreen(screen); -- -- QXcbIntegration::instance()->destroyScreen(screen); -- -- // QTBUG-40174, QTBUG-42985: If all screens are removed, wait -- // and start rendering again later if a screen becomes available. -- -+ destroyScreen(screen); - } else if (!screen && output.connection == XCB_RANDR_CONNECTION_CONNECTED) { - // New XRandR output is available and it's enabled - if (output.crtc != XCB_NONE && output.mode != XCB_NONE) { -@@ -278,59 +234,142 @@ void QXcbConnection::updateScreens(const xcb_randr_notify_event_t *event) - QScopedPointer outputInfo( - xcb_randr_get_output_info_reply(xcb_connection(), outputInfoCookie, NULL)); - -- screen = createScreen(virtualDesktop, output.output, outputInfo.data()); -- qCDebug(lcQpaScreen) << "output" << screen->name() << "is connected and enabled"; -- -- screen->setPrimary(checkOutputIsPrimary(output.window, output.output)); -- virtualDesktop->addScreen(screen); -- m_screens << screen; -- QXcbIntegration::instance()->screenAdded(screen, screen->isPrimary()); -+ // Find a fake screen -+ foreach (QPlatformScreen *scr, virtualDesktop->screens()) { -+ QXcbScreen *xcbScreen = (QXcbScreen *)scr; -+ if (xcbScreen->output() == XCB_NONE) { -+ screen = xcbScreen; -+ break; -+ } -+ } - -- // Windows which had null screens have already had expose events by now. -- // They need to be told the screen is back, it's OK to render. -- foreach (QWindow *window, QGuiApplication::topLevelWindows()) { -- QXcbWindow *xcbWin = static_cast(window->handle()); -- if (xcbWin) -- xcbWin->maybeSetScreen(screen); -+ if (screen) { -+ QString nameWas = screen->name(); -+ // Transform the fake screen into a physical screen -+ screen->setOutput(output.output, outputInfo.data()); -+ updateScreen(screen, output); -+ qCDebug(lcQpaScreen) << "output" << screen->name() -+ << "is connected and enabled; was fake:" << nameWas; -+ } else { -+ screen = createScreen(virtualDesktop, output, outputInfo.data()); -+ qCDebug(lcQpaScreen) << "output" << screen->name() << "is connected and enabled"; - } - } -- // else ignore disabled screens - } else if (screen) { -- // Screen has been disabled -> remove - if (output.crtc == XCB_NONE && output.mode == XCB_NONE) { -+ // Screen has been disabled - 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); -- virtualDesktop->removeScreen(screen); -- QXcbIntegration::instance()->destroyScreen(screen); -+ destroyScreen(screen); - } else { - qCDebug(lcQpaScreen) << "output" << screen->name() << "has been temporarily disabled for the mode switch"; -+ // Reset crtc to skip RRCrtcChangeNotify events, -+ // because they may be invalid in the middle of the mode switch -+ screen->setCrtc(XCB_NONE); - } - } else { -- // Just update existing screen -- screen->updateGeometry(output.config_timestamp); -- const bool wasPrimary = screen->isPrimary(); -- screen->setPrimary(checkOutputIsPrimary(output.window, output.output)); -- if (screen->mode() != output.mode) -- screen->updateRefreshRate(output.mode); -- -- // If the screen became primary, reshuffle the order in QGuiApplicationPrivate -- if (!wasPrimary && screen->isPrimary()) { -- const int idx = m_screens.indexOf(screen); -- m_screens.swap(0, idx); -- QXcbIntegration::instance()->setPrimaryScreen(screen); -- } -+ updateScreen(screen, output); - qCDebug(lcQpaScreen) << "output has changed" << screen; - } - } -+ -+ qCDebug(lcQpaScreen) << "primary output is" << m_screens.first()->name(); -+ } -+} -+ -+bool QXcbConnection::checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output) -+{ -+ xcb_generic_error_t *error = 0; -+ xcb_randr_get_output_primary_cookie_t primaryCookie = -+ xcb_randr_get_output_primary(xcb_connection(), rootWindow); -+ QScopedPointer primary ( -+ xcb_randr_get_output_primary_reply(xcb_connection(), primaryCookie, &error)); -+ if (!primary || error) { -+ qWarning("failed to get the primary output of the screen"); -+ free(error); -+ error = NULL; -+ } -+ const bool isPrimary = primary ? (primary->output == output) : false; -+ -+ return isPrimary; -+} -+ -+void QXcbConnection::updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange) -+{ -+ screen->setCrtc(outputChange.crtc); // Set the new crtc, because it can be invalid -+ screen->updateGeometry(outputChange.config_timestamp); -+ if (screen->mode() != outputChange.mode) -+ screen->updateRefreshRate(outputChange.mode); -+ // Only screen which belongs to the primary virtual desktop can be a primary screen -+ if (screen->screenNumber() == m_primaryScreenNumber) { -+ if (!screen->isPrimary() && checkOutputIsPrimary(outputChange.window, outputChange.output)) { -+ screen->setPrimary(true); -+ -+ // If the screen became primary, reshuffle the order in QGuiApplicationPrivate -+ const int idx = m_screens.indexOf(screen); -+ if (idx > 0) { -+ m_screens.first()->setPrimary(false); -+ m_screens.swap(0, idx); -+ } -+ screen->virtualDesktop()->setPrimaryScreen(screen); -+ QXcbIntegration::instance()->setPrimaryScreen(screen); -+ } -+ } -+} -+ -+QXcbScreen *QXcbConnection::createScreen(QXcbVirtualDesktop *virtualDesktop, -+ const xcb_randr_output_change_t &outputChange, -+ xcb_randr_get_output_info_reply_t *outputInfo) -+{ -+ QXcbScreen *screen = new QXcbScreen(this, virtualDesktop, outputChange.output, outputInfo); -+ // Only screen which belongs to the primary virtual desktop can be a primary screen -+ if (screen->screenNumber() == m_primaryScreenNumber) -+ screen->setPrimary(checkOutputIsPrimary(outputChange.window, outputChange.output)); -+ -+ if (screen->isPrimary()) { - if (!m_screens.isEmpty()) -- qCDebug(lcQpaScreen) << "primary output is" << m_screens.first()->name(); -- else -- qCDebug(lcQpaScreen) << "no outputs"; -+ m_screens.first()->setPrimary(false); -+ -+ m_screens.prepend(screen); -+ } else { -+ m_screens.append(screen); -+ } -+ virtualDesktop->addScreen(screen); -+ QXcbIntegration::instance()->screenAdded(screen, screen->isPrimary()); -+ -+ return screen; -+} -+ -+void QXcbConnection::destroyScreen(QXcbScreen *screen) -+{ -+ QXcbVirtualDesktop *virtualDesktop = screen->virtualDesktop(); -+ if (virtualDesktop->screens().count() == 1) { -+ // If there are no other screens on the same virtual desktop, -+ // then transform the physical screen into a fake screen. -+ const QString nameWas = screen->name(); -+ screen->setOutput(XCB_NONE, Q_NULLPTR); -+ qCDebug(lcQpaScreen) << "transformed" << nameWas << "to fake" << screen; -+ } else { -+ // There is more than one screen on the same virtual desktop, remove the screen -+ m_screens.removeOne(screen); -+ virtualDesktop->removeScreen(screen); -+ -+ // When primary screen is removed, set the new primary screen -+ // which belongs to the primary virtual desktop. -+ if (screen->isPrimary()) { -+ QXcbScreen *newPrimary = (QXcbScreen *)virtualDesktop->screens().at(0); -+ newPrimary->setPrimary(true); -+ const int idx = m_screens.indexOf(newPrimary); -+ if (idx > 0) -+ m_screens.swap(0, idx); -+ QXcbIntegration::instance()->setPrimaryScreen(newPrimary); -+ } -+ -+ QXcbIntegration::instance()->destroyScreen(screen); - } - } - -@@ -338,8 +377,7 @@ void QXcbConnection::initializeScreens() - { - xcb_screen_iterator_t it = xcb_setup_roots_iterator(m_setup); - int xcbScreenNumber = 0; // screen number in the xcb sense -- QXcbScreen* primaryScreen = Q_NULLPTR; -- bool hasOutputs = false; -+ QXcbScreen *primaryScreen = Q_NULLPTR; - while (it.rem) { - // Each "screen" in xcb terminology is a virtual desktop, - // potentially a collection of separate juxtaposed monitors. -@@ -348,8 +386,6 @@ void QXcbConnection::initializeScreens() - xcb_screen_t *xcbScreen = it.data; - QXcbVirtualDesktop *virtualDesktop = new QXcbVirtualDesktop(this, xcbScreen, xcbScreenNumber); - m_virtualDesktops.append(virtualDesktop); -- QList siblings; -- int outputCount = 0; - if (has_randr_extension) { - xcb_generic_error_t *error = NULL; - // RRGetScreenResourcesCurrent is fast but it may return nothing if the -@@ -366,7 +402,7 @@ void QXcbConnection::initializeScreens() - } else { - xcb_timestamp_t timestamp; - xcb_randr_output_t *outputs = Q_NULLPTR; -- outputCount = xcb_randr_get_screen_resources_current_outputs_length(resources_current.data()); -+ int outputCount = xcb_randr_get_screen_resources_current_outputs_length(resources_current.data()); - if (outputCount) { - timestamp = resources_current->config_timestamp; - outputs = xcb_randr_get_screen_resources_current_outputs(resources_current.data()); -@@ -393,6 +429,7 @@ void QXcbConnection::initializeScreens() - qWarning("failed to get the primary output of the screen"); - free(error); - } else { -+ QList siblings; - for (int i = 0; i < outputCount; i++) { - QScopedPointer output( - xcb_randr_get_output_info_reply(xcb_connection(), -@@ -416,9 +453,8 @@ void QXcbConnection::initializeScreens() - continue; - } - -- QXcbScreen *screen = createScreen(virtualDesktop, outputs[i], output.data()); -+ QXcbScreen *screen = new QXcbScreen(this, virtualDesktop, outputs[i], output.data()); - siblings << screen; -- hasOutputs = true; - m_screens << screen; - - // There can be multiple outputs per screen, use either -@@ -435,11 +471,23 @@ void QXcbConnection::initializeScreens() - } - } - } -+ virtualDesktop->setScreens(siblings); - } - } - } - } -- virtualDesktop->setScreens(siblings); -+ if (virtualDesktop->screens().isEmpty()) { -+ // If there are no XRandR outputs or XRandR extension is missing, -+ // then create a fake/legacy screen. -+ QXcbScreen *screen = new QXcbScreen(this, virtualDesktop, XCB_NONE, Q_NULLPTR); -+ qCDebug(lcQpaScreen) << "created fake screen" << screen; -+ m_screens << screen; -+ if (m_primaryScreenNumber == xcbScreenNumber) { -+ primaryScreen = screen; -+ primaryScreen->setPrimary(true); -+ } -+ virtualDesktop->addScreen(screen); -+ } - xcb_screen_next(&it); - ++xcbScreenNumber; - } // for each xcb screen -@@ -447,39 +495,25 @@ void QXcbConnection::initializeScreens() - foreach (QXcbVirtualDesktop *virtualDesktop, m_virtualDesktops) - virtualDesktop->subscribeToXFixesSelectionNotify(); - -- // If there's no randr extension, or there was some error above, or we found a -- // screen which doesn't have outputs for some other reason (e.g. on VNC or ssh -X), -- // but the dimensions are known anyway, and we don't already have any lingering -- // (possibly disconnected) screens, then showing windows should be possible, -- // so create one screen. (QTBUG-31389) -- QXcbVirtualDesktop *virtualDesktop = m_virtualDesktops.value(0); -- if (virtualDesktop && !hasOutputs && !virtualDesktop->size().isEmpty() && m_screens.isEmpty()) { -- QXcbScreen *screen = createScreen(virtualDesktop, 0, Q_NULLPTR); -- virtualDesktop->setScreens(QList() << screen); -- m_screens << screen; -- primaryScreen = screen; -- primaryScreen->setPrimary(true); -- qCDebug(lcQpaScreen) << "found a screen with zero outputs" << screen; -- } -- -- // Ensure the primary screen is first in the list -- if (primaryScreen) { -- Q_ASSERT(!m_screens.isEmpty()); -- if (m_screens.first() != primaryScreen) { -- m_screens.removeOne(primaryScreen); -- m_screens.prepend(primaryScreen); -+ if (m_virtualDesktops.isEmpty()) { -+ qFatal("QXcbConnection: no screens available"); -+ } else { -+ // Ensure the primary screen is first on the list -+ if (primaryScreen) { -+ if (m_screens.first() != primaryScreen) { -+ m_screens.removeOne(primaryScreen); -+ m_screens.prepend(primaryScreen); -+ } - } -- } - -- // Push the screens to QApplication -- QXcbIntegration *integration = QXcbIntegration::instance(); -- foreach (QXcbScreen* screen, m_screens) { -- qCDebug(lcQpaScreen) << "adding" << screen << "(Primary:" << screen->isPrimary() << ')'; -- integration->screenAdded(screen, screen->isPrimary()); -- } -+ // Push the screens to QGuiApplication -+ foreach (QXcbScreen *screen, m_screens) { -+ qCDebug(lcQpaScreen) << "adding" << screen << "(Primary:" << screen->isPrimary() << ")"; -+ QXcbIntegration::instance()->screenAdded(screen, screen->isPrimary()); -+ } - -- if (!m_screens.isEmpty()) - qCDebug(lcQpaScreen) << "primary output is" << m_screens.first()->name(); -+ } - } - - QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName) -@@ -553,9 +587,6 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra - initializeXFixes(); - initializeScreens(); - -- if (m_screens.isEmpty()) -- qFatal("QXcbConnection: no screens available"); -- - initializeXRender(); - m_xi2Enabled = false; - #if defined(XCB_USE_XINPUT2) -diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h -index 3c82170..fb7cc13 100644 ---- a/src/plugins/platforms/xcb/qxcbconnection.h -+++ b/src/plugins/platforms/xcb/qxcbconnection.h -@@ -518,15 +518,17 @@ private: - void initializeXShape(); - void initializeXKB(); - void handleClientMessageEvent(const xcb_client_message_event_t *event); -- QXcbScreen* createScreen(QXcbVirtualDesktop *virtualDesktop, -- xcb_randr_output_t outputId = XCB_NONE, -- xcb_randr_get_output_info_reply_t *output = 0); - QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc); - QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output); - QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow); -+ void updateScreens(const xcb_randr_notify_event_t *event); - bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); -+ void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); -+ QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, -+ const xcb_randr_output_change_t &outputChange, -+ xcb_randr_get_output_info_reply_t *outputInfo); -+ void destroyScreen(QXcbScreen *screen); - void initializeScreens(); -- void updateScreens(const xcb_randr_notify_event_t *event); - bool compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const; - - bool m_xi2Enabled; -diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp -index 0e99d58..f05432e 100644 ---- a/src/plugins/platforms/xcb/qxcbscreen.cpp -+++ b/src/plugins/platforms/xcb/qxcbscreen.cpp -@@ -81,6 +81,13 @@ void QXcbVirtualDesktop::addScreen(QPlatformScreen *s) - ((QXcbScreen *) s)->isPrimary() ? m_screens.prepend(s) : m_screens.append(s); - } - -+void QXcbVirtualDesktop::setPrimaryScreen(QPlatformScreen *s) -+{ -+ const int idx = m_screens.indexOf(s); -+ Q_ASSERT(idx > -1); -+ m_screens.swap(0, idx); -+} -+ - QXcbXSettings *QXcbVirtualDesktop::xSettings() const - { - if (!m_xSettings) { -@@ -149,16 +156,15 @@ void QXcbVirtualDesktop::updateWorkArea() - } - - QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, -- xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *output, -- QString outputName) -+ xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *output) - : QXcbObject(connection) - , m_virtualDesktop(virtualDesktop) - , m_output(outputId) -- , m_crtc(output ? output->crtc : 0) -+ , m_crtc(output ? output->crtc : XCB_NONE) - , m_mode(XCB_NONE) - , m_primary(false) - , m_rotation(XCB_RANDR_ROTATION_ROTATE_0) -- , m_outputName(outputName) -+ , m_outputName(getOutputName(output)) - , m_outputSizeMillimeters(output ? QSize(output->mm_width, output->mm_height) : QSize()) - , m_virtualSize(virtualDesktop->size()) - , m_virtualSizeMillimeters(virtualDesktop->physicalSize()) -@@ -268,6 +274,22 @@ QXcbScreen::~QXcbScreen() - delete m_cursor; - } - -+QString QXcbScreen::getOutputName(xcb_randr_get_output_info_reply_t *outputInfo) -+{ -+ QString name; -+ if (outputInfo) { -+ name = QString::fromUtf8((const char*)xcb_randr_get_output_info_name(outputInfo), -+ xcb_randr_get_output_info_name_length(outputInfo)); -+ } else { -+ QByteArray displayName = connection()->displayName(); -+ int dotPos = displayName.lastIndexOf('.'); -+ if (dotPos != -1) -+ displayName.truncate(dotPos); -+ name = QString::fromLocal8Bit(displayName) + QLatin1Char('.') -+ + QString::number(m_virtualDesktop->number()); -+ } -+ return name; -+} - - QWindow *QXcbScreen::topLevelAt(const QPoint &p) const - { -@@ -392,6 +414,16 @@ QPlatformCursor *QXcbScreen::cursor() const - return m_cursor; - } - -+void QXcbScreen::setOutput(xcb_randr_output_t outputId, -+ xcb_randr_get_output_info_reply_t *outputInfo) -+{ -+ m_output = outputId; -+ m_crtc = outputInfo ? outputInfo->crtc : XCB_NONE; -+ m_mode = XCB_NONE; -+ m_outputName = getOutputName(outputInfo); -+ // TODO: Send an event to the QScreen instance that the screen changed its name -+} -+ - /*! - \brief handle the XCB screen change event and update properties - -@@ -460,19 +492,10 @@ void QXcbScreen::handleScreenChange(xcb_randr_screen_change_notify_event_t *chan - - updateGeometry(change_event->timestamp); - -- QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), geometry(), availableGeometry()); - QWindowSystemInterface::handleScreenOrientationChange(QPlatformScreen::screen(), m_orientation); - - QDpi ldpi = logicalDpi(); - QWindowSystemInterface::handleScreenLogicalDotsPerInchChange(QPlatformScreen::screen(), ldpi.first, ldpi.second); -- -- // Windows which had null screens have already had expose events by now. -- // They need to be told the screen is back, it's OK to render. -- foreach (QWindow *window, QGuiApplication::topLevelWindows()) { -- QXcbWindow *xcbWin = static_cast(window->handle()); -- if (xcbWin) -- xcbWin->maybeSetScreen(this); -- } - } - - void QXcbScreen::updateGeometry(xcb_timestamp_t timestamp) -diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h -index c68c290..79620f4 100644 ---- a/src/plugins/platforms/xcb/qxcbscreen.h -+++ b/src/plugins/platforms/xcb/qxcbscreen.h -@@ -72,6 +72,7 @@ public: - void setScreens(QList sl) { m_screens = sl; } - void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } - void addScreen(QPlatformScreen *s); -+ void setPrimaryScreen(QPlatformScreen *s); - - QXcbXSettings *xSettings() const; - -@@ -101,10 +102,11 @@ class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen - { - public: - QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, -- xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *output, -- QString outputName); -+ xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); - ~QXcbScreen(); - -+ QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); -+ - QPixmap grabWindow(WId window, int x, int y, int width, int height) const Q_DECL_OVERRIDE; - - QWindow *topLevelAt(const QPoint &point) const Q_DECL_OVERRIDE; -@@ -137,6 +139,10 @@ public: - xcb_randr_crtc_t crtc() const { return m_crtc; } - xcb_randr_mode_t mode() const { return m_mode; } - -+ void setOutput(xcb_randr_output_t outputId, -+ xcb_randr_get_output_info_reply_t *outputInfo); -+ void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } -+ - void windowShown(QXcbWindow *window); - QString windowManagerName() const { return m_windowManagerName; } - bool syncRequestSupported() const { return m_syncRequestSupported; } -diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp -index 6add0a6..bdbb9e9 100644 ---- a/src/plugins/platforms/xcb/qxcbwindow.cpp -+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp -@@ -622,14 +622,6 @@ void QXcbWindow::destroy() - m_pendingSyncRequest->invalidate(); - } - --void QXcbWindow::maybeSetScreen(QXcbScreen *screen) --{ -- if (!window()->screen() && screen->geometry().contains(geometry().topLeft())) { -- QWindowSystemInterface::handleWindowScreenChanged(window(), static_cast(screen)->screen()); -- QWindowSystemInterface::handleExposeEvent(window(), QRegion(QRect(QPoint(0, 0), window()->size()))); -- } --} -- - void QXcbWindow::setGeometry(const QRect &rect) - { - QPlatformWindow::setGeometry(rect); -@@ -845,15 +837,13 @@ void QXcbWindow::hide() - Q_XCB_CALL(xcb_unmap_window(xcb_connection(), m_window)); - - // send synthetic UnmapNotify event according to icccm 4.1.4 -- if (xcbScreen()) { -- xcb_unmap_notify_event_t event; -- event.response_type = XCB_UNMAP_NOTIFY; -- event.event = xcbScreen()->root(); -- event.window = m_window; -- event.from_configure = false; -- Q_XCB_CALL(xcb_send_event(xcb_connection(), false, xcbScreen()->root(), -- XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *)&event)); -- } -+ xcb_unmap_notify_event_t event; -+ event.response_type = XCB_UNMAP_NOTIFY; -+ event.event = xcbScreen()->root(); -+ event.window = m_window; -+ event.from_configure = false; -+ Q_XCB_CALL(xcb_send_event(xcb_connection(), false, xcbScreen()->root(), -+ XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *)&event)); - - xcb_flush(xcb_connection()); - -@@ -1181,8 +1171,6 @@ void QXcbWindow::changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two) - event.data.data32[3] = 0; - event.data.data32[4] = 0; - -- if (!xcbScreen()) -- return; - Q_XCB_CALL(xcb_send_event(xcb_connection(), 0, xcbScreen()->root(), XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *)&event)); - } - -@@ -1435,8 +1423,6 @@ void QXcbWindow::setParent(const QPlatformWindow *parent) - xcb_parent_id = qXcbParent->xcb_window(); - m_embedded = qXcbParent->window()->type() == Qt::ForeignWindow; - } else { -- if (!xcbScreen()) -- return; - xcb_parent_id = xcbScreen()->root(); - m_embedded = false; - } -@@ -1992,7 +1978,7 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t * - { - bool fromSendEvent = (event->response_type & 0x80); - QPoint pos(event->x, event->y); -- if (!parent() && !fromSendEvent && xcbScreen()) { -+ if (!parent() && !fromSendEvent) { - // Do not trust the position, query it instead. - xcb_translate_coordinates_cookie_t cookie = xcb_translate_coordinates(xcb_connection(), xcb_window(), - xcbScreen()->root(), 0, 0); -@@ -2305,8 +2291,6 @@ void QXcbWindow::handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) - return; - - const QPoint local(event->event_x, event->event_y); -- if (!xcbScreen()) -- return; - QPoint global = QPoint(event->root_x, event->root_y); - QWindowSystemInterface::handleEnterEvent(window(), local, global); - } -@@ -2324,8 +2308,6 @@ void QXcbWindow::handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) - - if (enterWindow) { - QPoint local(enter->event_x, enter->event_y); -- if (!xcbScreen()) -- return; - QPoint global = QPoint(event->root_x, event->root_y); - - QWindowSystemInterface::handleEnterLeaveEvent(enterWindow->window(), window(), local, global); -@@ -2341,8 +2323,6 @@ void QXcbWindow::handlePropertyNotifyEvent(const xcb_property_notify_event_t *ev - connection()->setTime(event->time); - - const bool propertyDeleted = event->state == XCB_PROPERTY_DELETE; -- if (!xcbScreen()) -- return; - - if (event->atom == atom(QXcbAtom::_NET_WM_STATE) || event->atom == atom(QXcbAtom::WM_STATE)) { - if (propertyDeleted) -@@ -2662,8 +2642,6 @@ bool QXcbWindow::needsSync() const - - void QXcbWindow::postSyncWindowRequest() - { -- if (!xcbScreen()) -- return; - if (!m_pendingSyncRequest) { - QXcbSyncWindowRequest *e = new QXcbSyncWindowRequest(this); - m_pendingSyncRequest = e; -diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h -index 0d14673..69c0819 100644 ---- a/src/plugins/platforms/xcb/qxcbwindow.h -+++ b/src/plugins/platforms/xcb/qxcbwindow.h -@@ -167,7 +167,6 @@ public: - - virtual void create(); - virtual void destroy(); -- void maybeSetScreen(QXcbScreen *screen); - QXcbScreen *screenForNativeGeometry(const QRect &newGeometry) const; - - public Q_SLOTS: --- -2.5.0 - diff --git a/qt5-qtbase-QTBUG-47041.patch b/qt5-qtbase-QTBUG-47041.patch deleted file mode 100644 index ff1395c..0000000 --- a/qt5-qtbase-QTBUG-47041.patch +++ /dev/null @@ -1,45 +0,0 @@ -From b0b08cc0e4e38504d6b833702f7477aee4e2a192 Mon Sep 17 00:00:00 2001 -From: Ralf Jung -Date: Sun, 5 Jul 2015 12:15:29 +0200 -Subject: [PATCH] When a screen comes back online, the windows need to be told - about it - -On my system, this fixes the misbehavior of Qt applications when the (only) active screen is -switched, e.g. from an external screen to the laptop. -This behavior is caused by the screen() of widgets to be set to NULL when their screen goes away. -When a new screen comes online, the widgets *should* be told about it, but they are not. The only -place that "maybeSetScreen" is called is when an existing screen changes its geometry, but not -when a screen gets enabled without its geometry being affected in any way (e.g. because it was -just disabled via xrandr, but has been connected all along). This makes sure that "maybeSetScreen" -is also called when a screen gets enabled. - -Task-number: QTBUG-47041 -Change-Id: Ic72d6beaa544bf9a4efdbea0830b1bc0d6ce5362 -Reviewed-by: Dmitry Shachnev -Reviewed-by: Shawn Rutledge ---- - src/plugins/platforms/xcb/qxcbconnection.cpp | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp -index 74f48b0..0867615 100644 ---- a/src/plugins/platforms/xcb/qxcbconnection.cpp -+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp -@@ -252,6 +252,14 @@ void QXcbConnection::updateScreens(const xcb_randr_notify_event_t *event) - otherScreen->addVirtualSibling(screen); - m_screens << screen; - QXcbIntegration::instance()->screenAdded(screen, screen->isPrimary()); -+ -+ // Windows which had null screens have already had expose events by now. -+ // They need to be told the screen is back, it's OK to render. -+ foreach (QWindow *window, QGuiApplication::topLevelWindows()) { -+ QXcbWindow *xcbWin = static_cast(window->handle()); -+ if (xcbWin) -+ xcbWin->maybeSetScreen(screen); -+ } - } - // else ignore disabled screens - } else if (screen) { --- -2.3.5 - diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index b5b04b7..e29afe6 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -39,12 +39,16 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.15%{?dist} +Release: 0.16%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions Url: http://qt-project.org/ +%if 0%{?prerelease:1} +Source0: http://download.qt.io/development_releases/qt/5.6/%{version}-%{prerelease}/submodules/%{qt_module}-opensource-src-%{version}-%{prerelease}.tar.gz +%else Source0: http://download.qt.io/official_releases/qt/5.6/%{version}%{?prerelease:-%{prerelease}}/submodules/%{qt_module}-opensource-src-%{version}%{?prerelease:-%{prerelease}}.tar.gz +%endif # header file to workaround multilib issue # https://bugzilla.redhat.com/show_bug.cgi?id=1036956 @@ -83,11 +87,6 @@ Patch52: qtbase-opensource-src-5.6.0-moc_WORDSIZE.patch # 'make docs' crash on el6, use qSort instead of std::sort Patch100: qtbase-opensource-src-5.4.0-QTBUG-43057.patch -Patch101: 0001-XCB-prevent-a-fp-division-by-zero.patch -Patch102: 0002-xcb-compare-to-previous-state-when-sending-geometry-.patch -Patch111: 0011-xcb-Don-t-cache-the-screen-for-a-window.patch -Patch112: 0012-xcb-Use-a-placeholder-QScreen-when-there-are-no-outp.patch - # recently passed code review, not integrated yet # https://codereview.qt-project.org/126102/ Patch150: moc-get-the-system-defines-from-the-compiler-itself.patch @@ -331,10 +330,6 @@ rm -fv mkspecs/linux-g++*/qmake.conf.multilib-optflags %patch100 -p1 -b .QTBUG-43057 %endif -%patch101 -p1 -b .0001 -%patch102 -p1 -b .0002 -%patch111 -p1 -b .0011 -%patch112 -p1 -b .0012 %patch150 -p1 -b .moc_system_defines # drop -fexceptions from $RPM_OPT_FLAGS @@ -868,6 +863,9 @@ fi %changelog +* Fri Dec 18 2015 Rex Dieter 5.6.0-0.16 +- 5.6.0-beta (final) + * Wed Dec 16 2015 Rex Dieter - 5.6.0-0.15 - pull in another upstream moc fix/improvement (#1290020,QTBUG-49972) - fix bootstrap/docs diff --git a/qtbase-opensource-src-5.6.0-xcb-gerrit-138201.patch b/qtbase-opensource-src-5.6.0-xcb-gerrit-138201.patch deleted file mode 100644 index 52e4020..0000000 --- a/qtbase-opensource-src-5.6.0-xcb-gerrit-138201.patch +++ /dev/null @@ -1,704 +0,0 @@ -From 56657b57083caa77e368452b07224bb70082bbc6 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= -Date: Fri, 16 Oct 2015 22:51:59 +0200 -Subject: [PATCH] xcb: QScreen is a placeholder whenever there are no outputs - connected - -If no screens are available, windows could disappear, could stop rendering -graphics, or the application could crash. This is a real use case in several -scenarios: with x11vnc, when all monitors are physically disconnected from a -desktop machine, or in some cases even when the monitor sleeps. Now when the -last screen is disconnected, it is transformed into a fake screen. When a -physical screen appears, the fake QScreen is transformed into a representation -of the physical screen. Every virtual desktop has its own fake screen, and -primary screens must belong to the primary virtual desktop. It fixes updating -screen geometry on temporarily disabled screens in the middle of the mode -switch. - -Expected results: Windows don't disappear, the application doesn't -crash, and QMenu is displayed on the appropriate screen. - -This reverts patch 51ada7734ad780178ecced11e0dff454dfc2e5f2 - -Change-Id: I6e8eb682b0c8425d08ffdaecbd4c6c7700c914b4 -Task-number: QTBUG-42985 ---- - src/gui/kernel/qscreen.cpp | 4 +- - src/plugins/platforms/xcb/qxcbconnection.cpp | 265 +++++++++++++++------------ - src/plugins/platforms/xcb/qxcbconnection.h | 10 +- - src/plugins/platforms/xcb/qxcbscreen.cpp | 49 +++-- - src/plugins/platforms/xcb/qxcbscreen.h | 10 +- - src/plugins/platforms/xcb/qxcbwindow.cpp | 38 +--- - src/plugins/platforms/xcb/qxcbwindow.h | 1 - - 7 files changed, 205 insertions(+), 172 deletions(-) - -diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp -index b6b5037..4338db2 100644 ---- a/src/gui/kernel/qscreen.cpp -+++ b/src/gui/kernel/qscreen.cpp -@@ -116,8 +116,8 @@ QScreen::~QScreen() - bool movingFromVirtualSibling = primaryScreen && primaryScreen->handle()->virtualSiblings().contains(handle()); - - // Move any leftover windows to the primary screen -- foreach (QWindow *window, QGuiApplication::topLevelWindows()) { -- if (window->screen() != this) -+ foreach (QWindow *window, QGuiApplication::allWindows()) { -+ if (!window->isTopLevel() || window->screen() != this) - continue; - - const bool wasVisible = window->isVisible(); -diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp -index 901764b..66a794a 100644 ---- a/src/plugins/platforms/xcb/qxcbconnection.cpp -+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp -@@ -179,42 +179,6 @@ QXcbScreen* QXcbConnection::findScreenForOutput(xcb_window_t rootWindow, xcb_ran - return 0; - } - --QXcbScreen* QXcbConnection::createScreen(QXcbVirtualDesktop* virtualDesktop, -- xcb_randr_output_t outputId, -- xcb_randr_get_output_info_reply_t *output) --{ -- QString name; -- if (output) -- name = QString::fromUtf8((const char*)xcb_randr_get_output_info_name(output), -- xcb_randr_get_output_info_name_length(output)); -- else { -- QByteArray displayName = m_displayName; -- int dotPos = displayName.lastIndexOf('.'); -- if (dotPos != -1) -- displayName.truncate(dotPos); -- name = QString::fromLocal8Bit(displayName) + QLatin1Char('.') + QString::number(virtualDesktop->number()); -- } -- -- return new QXcbScreen(this, virtualDesktop, outputId, output, name); --} -- --bool QXcbConnection::checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output) --{ -- xcb_generic_error_t *error = 0; -- xcb_randr_get_output_primary_cookie_t primaryCookie = -- xcb_randr_get_output_primary(xcb_connection(), rootWindow); -- QScopedPointer primary ( -- xcb_randr_get_output_primary_reply(xcb_connection(), primaryCookie, &error)); -- if (!primary || error) { -- qWarning("failed to get the primary output of the screen"); -- free(error); -- error = NULL; -- } -- const bool isPrimary = primary ? (primary->output == output) : false; -- -- return isPrimary; --} -- - QXcbVirtualDesktop* QXcbConnection::virtualDesktopForRootWindow(xcb_window_t rootWindow) - { - foreach (QXcbVirtualDesktop *virtualDesktop, m_virtualDesktops) { -@@ -260,16 +224,7 @@ void QXcbConnection::updateScreens(const xcb_randr_notify_event_t *event) - - if (screen && output.connection == XCB_RANDR_CONNECTION_DISCONNECTED) { - qCDebug(lcQpaScreen) << "screen" << screen->name() << "has been disconnected"; -- -- // Known screen removed -> delete it -- m_screens.removeOne(screen); -- virtualDesktop->removeScreen(screen); -- -- QXcbIntegration::instance()->destroyScreen(screen); -- -- // QTBUG-40174, QTBUG-42985: If all screens are removed, wait -- // and start rendering again later if a screen becomes available. -- -+ destroyScreen(screen); - } else if (!screen && output.connection == XCB_RANDR_CONNECTION_CONNECTED) { - // New XRandR output is available and it's enabled - if (output.crtc != XCB_NONE && output.mode != XCB_NONE) { -@@ -278,59 +233,138 @@ void QXcbConnection::updateScreens(const xcb_randr_notify_event_t *event) - QScopedPointer outputInfo( - xcb_randr_get_output_info_reply(xcb_connection(), outputInfoCookie, NULL)); - -- screen = createScreen(virtualDesktop, output.output, outputInfo.data()); -- qCDebug(lcQpaScreen) << "output" << screen->name() << "is connected and enabled"; -+ // Find a fake screen -+ foreach (QPlatformScreen *screen, virtualDesktop->screens()) { -+ QXcbScreen *xcbScreen = (QXcbScreen *)screen; -+ if (xcbScreen->output() == XCB_NONE) { -+ screen = xcbScreen; -+ break; -+ } -+ } - -- screen->setPrimary(checkOutputIsPrimary(output.window, output.output)); -- virtualDesktop->addScreen(screen); -- m_screens << screen; -- QXcbIntegration::instance()->screenAdded(screen, screen->isPrimary()); -- -- // Windows which had null screens have already had expose events by now. -- // They need to be told the screen is back, it's OK to render. -- foreach (QWindow *window, QGuiApplication::topLevelWindows()) { -- QXcbWindow *xcbWin = static_cast(window->handle()); -- if (xcbWin) -- xcbWin->maybeSetScreen(screen); -+ if (screen) { -+ // Transform the fake screen into a physical screen -+ screen->setOutput(output.output, outputInfo.data()); -+ updateScreen(screen, output); -+ } else { -+ screen = createScreen(virtualDesktop, output, outputInfo.data()); - } -+ -+ qCDebug(lcQpaScreen) << "output" << screen->name() << "is connected and enabled"; - } -- // else ignore disabled screens - } else if (screen) { -- // Screen has been disabled -> remove - if (output.crtc == XCB_NONE && output.mode == XCB_NONE) { -+ // Screen has been disabled - 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); -- virtualDesktop->removeScreen(screen); -- QXcbIntegration::instance()->destroyScreen(screen); -+ destroyScreen(screen); - } else { - qCDebug(lcQpaScreen) << "output" << screen->name() << "has been temporarily disabled for the mode switch"; -+ // Reset crtc to skip RRCrtcChangeNotify events, -+ // because they may be invalid in the middle of the mode switch -+ screen->setCrtc(XCB_NONE); - } - } else { -- // Just update existing screen -- screen->updateGeometry(output.config_timestamp); -- const bool wasPrimary = screen->isPrimary(); -- screen->setPrimary(checkOutputIsPrimary(output.window, output.output)); -- if (screen->mode() != output.mode) -- screen->updateRefreshRate(output.mode); -- -- // If the screen became primary, reshuffle the order in QGuiApplicationPrivate -- if (!wasPrimary && screen->isPrimary()) { -- const int idx = m_screens.indexOf(screen); -- m_screens.swap(0, idx); -- QXcbIntegration::instance()->setPrimaryScreen(screen); -- } -+ updateScreen(screen, output); - qCDebug(lcQpaScreen) << "output has changed" << screen; - } - } -+ -+ qCDebug(lcQpaScreen) << "primary output is" << m_screens.first()->name(); -+ } -+} -+ -+bool QXcbConnection::checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output) -+{ -+ xcb_generic_error_t *error = 0; -+ xcb_randr_get_output_primary_cookie_t primaryCookie = -+ xcb_randr_get_output_primary(xcb_connection(), rootWindow); -+ QScopedPointer primary ( -+ xcb_randr_get_output_primary_reply(xcb_connection(), primaryCookie, &error)); -+ if (!primary || error) { -+ qWarning("failed to get the primary output of the screen"); -+ free(error); -+ error = NULL; -+ } -+ const bool isPrimary = primary ? (primary->output == output) : false; -+ -+ return isPrimary; -+} -+ -+void QXcbConnection::updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange) -+{ -+ screen->setCrtc(outputChange.crtc); // Set the new crtc, because it can be invalid -+ screen->updateGeometry(outputChange.config_timestamp); -+ if (screen->mode() != outputChange.mode) -+ screen->updateRefreshRate(outputChange.mode); -+ // Only screen which belongs to the primary virtual desktop can be a primary screen -+ if (screen->screenNumber() == m_primaryScreenNumber) { -+ if (!screen->isPrimary() && checkOutputIsPrimary(outputChange.window, outputChange.output)) { -+ screen->setPrimary(true); -+ -+ // If the screen became primary, reshuffle the order in QGuiApplicationPrivate -+ const int idx = m_screens.indexOf(screen); -+ if (idx > 0) { -+ m_screens.first()->setPrimary(false); -+ m_screens.swap(0, idx); -+ } -+ screen->virtualDesktop()->setPrimaryScreen(screen); -+ QXcbIntegration::instance()->setPrimaryScreen(screen); -+ } -+ } -+} -+ -+QXcbScreen *QXcbConnection::createScreen(QXcbVirtualDesktop *virtualDesktop, -+ const xcb_randr_output_change_t &outputChange, -+ xcb_randr_get_output_info_reply_t *outputInfo) -+{ -+ QXcbScreen *screen = new QXcbScreen(this, virtualDesktop, outputChange.output, outputInfo); -+ // Only screen which belongs to the primary virtual desktop can be a primary screen -+ if (screen->screenNumber() == m_primaryScreenNumber) -+ screen->setPrimary(checkOutputIsPrimary(outputChange.window, outputChange.output)); -+ -+ if (screen->isPrimary()) { - if (!m_screens.isEmpty()) -- qCDebug(lcQpaScreen) << "primary output is" << m_screens.first()->name(); -- else -- qCDebug(lcQpaScreen) << "no outputs"; -+ m_screens.first()->setPrimary(false); -+ -+ m_screens.prepend(screen); -+ } else { -+ m_screens.append(screen); -+ } -+ virtualDesktop->addScreen(screen); -+ QXcbIntegration::instance()->screenAdded(screen, screen->isPrimary()); -+ -+ return screen; -+} -+ -+void QXcbConnection::destroyScreen(QXcbScreen *screen) -+{ -+ QXcbVirtualDesktop *virtualDesktop = screen->virtualDesktop(); -+ if (virtualDesktop->screens().count() == 1) { -+ // If there are no other screens on the same virtual desktop, -+ // then transform the physical screen into a fake screen. -+ screen->setOutput(XCB_NONE, Q_NULLPTR); -+ } else { -+ // There is more than one screen on the same virtual desktop, remove the screen -+ m_screens.removeOne(screen); -+ virtualDesktop->removeScreen(screen); -+ -+ // When primary screen is removed, set the new primary screen -+ // which belongs to the primary virtual desktop. -+ if (screen->isPrimary()) { -+ QXcbScreen *newPrimary = (QXcbScreen *)virtualDesktop->screens().at(0); -+ newPrimary->setPrimary(true); -+ const int idx = m_screens.indexOf(newPrimary); -+ if (idx > 0) -+ m_screens.swap(0, idx); -+ QXcbIntegration::instance()->setPrimaryScreen(newPrimary); -+ } -+ -+ QXcbIntegration::instance()->destroyScreen(screen); - } - } - -@@ -338,8 +372,7 @@ void QXcbConnection::initializeScreens() - { - xcb_screen_iterator_t it = xcb_setup_roots_iterator(m_setup); - int xcbScreenNumber = 0; // screen number in the xcb sense -- QXcbScreen* primaryScreen = Q_NULLPTR; -- bool hasOutputs = false; -+ QXcbScreen *primaryScreen = Q_NULLPTR; - while (it.rem) { - // Each "screen" in xcb terminology is a virtual desktop, - // potentially a collection of separate juxtaposed monitors. -@@ -348,8 +381,6 @@ void QXcbConnection::initializeScreens() - xcb_screen_t *xcbScreen = it.data; - QXcbVirtualDesktop *virtualDesktop = new QXcbVirtualDesktop(this, xcbScreen, xcbScreenNumber); - m_virtualDesktops.append(virtualDesktop); -- QList siblings; -- int outputCount = 0; - if (has_randr_extension) { - xcb_generic_error_t *error = NULL; - // RRGetScreenResourcesCurrent is fast but it may return nothing if the -@@ -366,7 +397,7 @@ void QXcbConnection::initializeScreens() - } else { - xcb_timestamp_t timestamp; - xcb_randr_output_t *outputs = Q_NULLPTR; -- outputCount = xcb_randr_get_screen_resources_current_outputs_length(resources_current.data()); -+ int outputCount = xcb_randr_get_screen_resources_current_outputs_length(resources_current.data()); - if (outputCount) { - timestamp = resources_current->config_timestamp; - outputs = xcb_randr_get_screen_resources_current_outputs(resources_current.data()); -@@ -393,6 +424,7 @@ void QXcbConnection::initializeScreens() - qWarning("failed to get the primary output of the screen"); - free(error); - } else { -+ QList siblings; - for (int i = 0; i < outputCount; i++) { - QScopedPointer output( - xcb_randr_get_output_info_reply(xcb_connection(), -@@ -416,9 +448,8 @@ void QXcbConnection::initializeScreens() - continue; - } - -- QXcbScreen *screen = createScreen(virtualDesktop, outputs[i], output.data()); -+ QXcbScreen *screen = new QXcbScreen(this, virtualDesktop, outputs[i], output.data()); - siblings << screen; -- hasOutputs = true; - m_screens << screen; - - // There can be multiple outputs per screen, use either -@@ -435,11 +466,22 @@ void QXcbConnection::initializeScreens() - } - } - } -+ virtualDesktop->setScreens(siblings); - } - } - } - } -- virtualDesktop->setScreens(siblings); -+ if (virtualDesktop->screens().isEmpty()) { -+ // If there are no XRandR outputs or XRandR extension is missing, -+ // then create a fake/legacy screen. -+ QXcbScreen *screen = new QXcbScreen(this, virtualDesktop, XCB_NONE, Q_NULLPTR); -+ m_screens << screen; -+ if (m_primaryScreenNumber == xcbScreenNumber) { -+ primaryScreen = screen; -+ primaryScreen->setPrimary(true); -+ } -+ virtualDesktop->addScreen(screen); -+ } - xcb_screen_next(&it); - ++xcbScreenNumber; - } // for each xcb screen -@@ -447,39 +489,25 @@ void QXcbConnection::initializeScreens() - foreach (QXcbVirtualDesktop *virtualDesktop, m_virtualDesktops) - virtualDesktop->subscribeToXFixesSelectionNotify(); - -- // If there's no randr extension, or there was some error above, or we found a -- // screen which doesn't have outputs for some other reason (e.g. on VNC or ssh -X), -- // but the dimensions are known anyway, and we don't already have any lingering -- // (possibly disconnected) screens, then showing windows should be possible, -- // so create one screen. (QTBUG-31389) -- QXcbVirtualDesktop *virtualDesktop = m_virtualDesktops.value(0); -- if (virtualDesktop && !hasOutputs && !virtualDesktop->size().isEmpty() && m_screens.isEmpty()) { -- QXcbScreen *screen = createScreen(virtualDesktop, 0, Q_NULLPTR); -- virtualDesktop->setScreens(QList() << screen); -- m_screens << screen; -- primaryScreen = screen; -- primaryScreen->setPrimary(true); -- qCDebug(lcQpaScreen) << "found a screen with zero outputs" << screen; -- } -- -- // Ensure the primary screen is first in the list -- if (primaryScreen) { -- Q_ASSERT(!m_screens.isEmpty()); -- if (m_screens.first() != primaryScreen) { -- m_screens.removeOne(primaryScreen); -- m_screens.prepend(primaryScreen); -+ if (m_virtualDesktops.isEmpty()) { -+ qFatal("QXcbConnection: no screens available"); -+ } else { -+ // Ensure the primary screen is first on the list -+ if (primaryScreen) { -+ if (m_screens.first() != primaryScreen) { -+ m_screens.removeOne(primaryScreen); -+ m_screens.prepend(primaryScreen); -+ } - } -- } - -- // Push the screens to QApplication -- QXcbIntegration *integration = QXcbIntegration::instance(); -- foreach (QXcbScreen* screen, m_screens) { -- qCDebug(lcQpaScreen) << "adding" << screen << "(Primary:" << screen->isPrimary() << ')'; -- integration->screenAdded(screen, screen->isPrimary()); -- } -+ // Push the screens to QGuiApplication -+ foreach (QXcbScreen *screen, m_screens) { -+ qCDebug(lcQpaScreen) << "adding" << screen << "(Primary:" << screen->isPrimary() << ")"; -+ QXcbIntegration::instance()->screenAdded(screen, screen->isPrimary()); -+ } - -- if (!m_screens.isEmpty()) - qCDebug(lcQpaScreen) << "primary output is" << m_screens.first()->name(); -+ } - } - - QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName) -@@ -553,9 +581,6 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra - initializeXFixes(); - initializeScreens(); - -- if (m_screens.isEmpty()) -- qFatal("QXcbConnection: no screens available"); -- - initializeXRender(); - m_xi2Enabled = false; - #if defined(XCB_USE_XINPUT2) -diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h -index 3c82170..fb7cc13 100644 ---- a/src/plugins/platforms/xcb/qxcbconnection.h -+++ b/src/plugins/platforms/xcb/qxcbconnection.h -@@ -518,15 +518,17 @@ private: - void initializeXShape(); - void initializeXKB(); - void handleClientMessageEvent(const xcb_client_message_event_t *event); -- QXcbScreen* createScreen(QXcbVirtualDesktop *virtualDesktop, -- xcb_randr_output_t outputId = XCB_NONE, -- xcb_randr_get_output_info_reply_t *output = 0); - QXcbScreen* findScreenForCrtc(xcb_window_t rootWindow, xcb_randr_crtc_t crtc); - QXcbScreen* findScreenForOutput(xcb_window_t rootWindow, xcb_randr_output_t output); - QXcbVirtualDesktop* virtualDesktopForRootWindow(xcb_window_t rootWindow); -+ void updateScreens(const xcb_randr_notify_event_t *event); - bool checkOutputIsPrimary(xcb_window_t rootWindow, xcb_randr_output_t output); -+ void updateScreen(QXcbScreen *screen, const xcb_randr_output_change_t &outputChange); -+ QXcbScreen *createScreen(QXcbVirtualDesktop *virtualDesktop, -+ const xcb_randr_output_change_t &outputChange, -+ xcb_randr_get_output_info_reply_t *outputInfo); -+ void destroyScreen(QXcbScreen *screen); - void initializeScreens(); -- void updateScreens(const xcb_randr_notify_event_t *event); - bool compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const; - - bool m_xi2Enabled; -diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp -index 2a53b18..bf3c0a6 100644 ---- a/src/plugins/platforms/xcb/qxcbscreen.cpp -+++ b/src/plugins/platforms/xcb/qxcbscreen.cpp -@@ -81,6 +81,13 @@ void QXcbVirtualDesktop::addScreen(QPlatformScreen *s) - ((QXcbScreen *) s)->isPrimary() ? m_screens.prepend(s) : m_screens.append(s); - } - -+void QXcbVirtualDesktop::setPrimaryScreen(QPlatformScreen *s) -+{ -+ const int idx = m_screens.indexOf(s); -+ Q_ASSERT(idx > -1); -+ m_screens.swap(0, idx); -+} -+ - QXcbXSettings *QXcbVirtualDesktop::xSettings() const - { - if (!m_xSettings) { -@@ -149,16 +156,15 @@ void QXcbVirtualDesktop::updateWorkArea() - } - - QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, -- xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *output, -- QString outputName) -+ xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *output) - : QXcbObject(connection) - , m_virtualDesktop(virtualDesktop) - , m_output(outputId) -- , m_crtc(output ? output->crtc : 0) -+ , m_crtc(output ? output->crtc : XCB_NONE) - , m_mode(XCB_NONE) - , m_primary(false) - , m_rotation(XCB_RANDR_ROTATION_ROTATE_0) -- , m_outputName(outputName) -+ , m_outputName(getOutputName(output)) - , m_outputSizeMillimeters(output ? QSize(output->mm_width, output->mm_height) : QSize()) - , m_virtualSize(virtualDesktop->size()) - , m_virtualSizeMillimeters(virtualDesktop->physicalSize()) -@@ -268,6 +274,22 @@ QXcbScreen::~QXcbScreen() - delete m_cursor; - } - -+QString QXcbScreen::getOutputName(xcb_randr_get_output_info_reply_t *outputInfo) -+{ -+ QString name; -+ if (outputInfo) { -+ name = QString::fromUtf8((const char*)xcb_randr_get_output_info_name(outputInfo), -+ xcb_randr_get_output_info_name_length(outputInfo)); -+ } else { -+ QByteArray displayName = connection()->displayName(); -+ int dotPos = displayName.lastIndexOf('.'); -+ if (dotPos != -1) -+ displayName.truncate(dotPos); -+ name = QString::fromLocal8Bit(displayName) + QLatin1Char('.') -+ + QString::number(m_virtualDesktop->number()); -+ } -+ return name; -+} - - QWindow *QXcbScreen::topLevelAt(const QPoint &p) const - { -@@ -392,6 +414,16 @@ QPlatformCursor *QXcbScreen::cursor() const - return m_cursor; - } - -+void QXcbScreen::setOutput(xcb_randr_output_t outputId, -+ xcb_randr_get_output_info_reply_t *outputInfo) -+{ -+ m_output = outputId; -+ m_crtc = outputInfo ? outputInfo->crtc : XCB_NONE; -+ m_mode = XCB_NONE; -+ m_outputName = getOutputName(outputInfo); -+ // TODO: Send an event to the QScreen instance that the screen changed its name -+} -+ - /*! - \brief handle the XCB screen change event and update properties - -@@ -460,19 +492,10 @@ void QXcbScreen::handleScreenChange(xcb_randr_screen_change_notify_event_t *chan - - updateGeometry(change_event->timestamp); - -- QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), geometry(), availableGeometry()); - QWindowSystemInterface::handleScreenOrientationChange(QPlatformScreen::screen(), m_orientation); - - QDpi ldpi = logicalDpi(); - QWindowSystemInterface::handleScreenLogicalDotsPerInchChange(QPlatformScreen::screen(), ldpi.first, ldpi.second); -- -- // Windows which had null screens have already had expose events by now. -- // They need to be told the screen is back, it's OK to render. -- foreach (QWindow *window, QGuiApplication::topLevelWindows()) { -- QXcbWindow *xcbWin = static_cast(window->handle()); -- if (xcbWin) -- xcbWin->maybeSetScreen(this); -- } - } - - void QXcbScreen::updateGeometry(xcb_timestamp_t timestamp) -diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h -index c68c290..79620f4 100644 ---- a/src/plugins/platforms/xcb/qxcbscreen.h -+++ b/src/plugins/platforms/xcb/qxcbscreen.h -@@ -72,6 +72,7 @@ public: - void setScreens(QList sl) { m_screens = sl; } - void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); } - void addScreen(QPlatformScreen *s); -+ void setPrimaryScreen(QPlatformScreen *s); - - QXcbXSettings *xSettings() const; - -@@ -101,10 +102,11 @@ class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen - { - public: - QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, -- xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *output, -- QString outputName); -+ xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); - ~QXcbScreen(); - -+ QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); -+ - QPixmap grabWindow(WId window, int x, int y, int width, int height) const Q_DECL_OVERRIDE; - - QWindow *topLevelAt(const QPoint &point) const Q_DECL_OVERRIDE; -@@ -137,6 +139,10 @@ public: - xcb_randr_crtc_t crtc() const { return m_crtc; } - xcb_randr_mode_t mode() const { return m_mode; } - -+ void setOutput(xcb_randr_output_t outputId, -+ xcb_randr_get_output_info_reply_t *outputInfo); -+ void setCrtc(xcb_randr_crtc_t crtc) { m_crtc = crtc; } -+ - void windowShown(QXcbWindow *window); - QString windowManagerName() const { return m_windowManagerName; } - bool syncRequestSupported() const { return m_syncRequestSupported; } -diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp -index d0efb68..cbb67f0 100644 ---- a/src/plugins/platforms/xcb/qxcbwindow.cpp -+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp -@@ -627,14 +627,6 @@ void QXcbWindow::destroy() - m_pendingSyncRequest->invalidate(); - } - --void QXcbWindow::maybeSetScreen(QXcbScreen *screen) --{ -- if (!window()->screen() && screen->geometry().contains(geometry().topLeft())) { -- QWindowSystemInterface::handleWindowScreenChanged(window(), static_cast(screen)->screen()); -- QWindowSystemInterface::handleExposeEvent(window(), QRegion(QRect(QPoint(0, 0), window()->size()))); -- } --} -- - void QXcbWindow::setGeometry(const QRect &rect) - { - QPlatformWindow::setGeometry(rect); -@@ -850,15 +842,13 @@ void QXcbWindow::hide() - Q_XCB_CALL(xcb_unmap_window(xcb_connection(), m_window)); - - // send synthetic UnmapNotify event according to icccm 4.1.4 -- if (xcbScreen()) { -- xcb_unmap_notify_event_t event; -- event.response_type = XCB_UNMAP_NOTIFY; -- event.event = xcbScreen()->root(); -- event.window = m_window; -- event.from_configure = false; -- Q_XCB_CALL(xcb_send_event(xcb_connection(), false, xcbScreen()->root(), -- XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *)&event)); -- } -+ xcb_unmap_notify_event_t event; -+ event.response_type = XCB_UNMAP_NOTIFY; -+ event.event = xcbScreen()->root(); -+ event.window = m_window; -+ event.from_configure = false; -+ Q_XCB_CALL(xcb_send_event(xcb_connection(), false, xcbScreen()->root(), -+ XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *)&event)); - - xcb_flush(xcb_connection()); - -@@ -1186,8 +1176,6 @@ void QXcbWindow::changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two) - event.data.data32[3] = 0; - event.data.data32[4] = 0; - -- if (!xcbScreen()) -- return; - Q_XCB_CALL(xcb_send_event(xcb_connection(), 0, xcbScreen()->root(), XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *)&event)); - } - -@@ -1440,8 +1428,6 @@ void QXcbWindow::setParent(const QPlatformWindow *parent) - xcb_parent_id = qXcbParent->xcb_window(); - m_embedded = qXcbParent->window()->type() == Qt::ForeignWindow; - } else { -- if (!xcbScreen()) -- return; - xcb_parent_id = xcbScreen()->root(); - m_embedded = false; - } -@@ -1997,7 +1983,7 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t * - { - bool fromSendEvent = (event->response_type & 0x80); - QPoint pos(event->x, event->y); -- if (!parent() && !fromSendEvent && xcbScreen()) { -+ if (!parent() && !fromSendEvent) { - // Do not trust the position, query it instead. - xcb_translate_coordinates_cookie_t cookie = xcb_translate_coordinates(xcb_connection(), xcb_window(), - xcbScreen()->root(), 0, 0); -@@ -2297,8 +2283,6 @@ void QXcbWindow::handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) - return; - - const QPoint local(event->event_x, event->event_y); -- if (!xcbScreen()) -- return; - QPoint global = QPoint(event->root_x, event->root_y); - QWindowSystemInterface::handleEnterEvent(window(), local, global); - } -@@ -2316,8 +2300,6 @@ void QXcbWindow::handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) - - if (enterWindow) { - QPoint local(enter->event_x, enter->event_y); -- if (!xcbScreen()) -- return; - QPoint global = QPoint(event->root_x, event->root_y); - - QWindowSystemInterface::handleEnterLeaveEvent(enterWindow->window(), window(), local, global); -@@ -2333,8 +2315,6 @@ void QXcbWindow::handlePropertyNotifyEvent(const xcb_property_notify_event_t *ev - connection()->setTime(event->time); - - const bool propertyDeleted = event->state == XCB_PROPERTY_DELETE; -- if (!xcbScreen()) -- return; - - if (event->atom == atom(QXcbAtom::_NET_WM_STATE) || event->atom == atom(QXcbAtom::WM_STATE)) { - if (propertyDeleted) -@@ -2654,8 +2634,6 @@ bool QXcbWindow::needsSync() const - - void QXcbWindow::postSyncWindowRequest() - { -- if (!xcbScreen()) -- return; - if (!m_pendingSyncRequest) { - QXcbSyncWindowRequest *e = new QXcbSyncWindowRequest(this); - m_pendingSyncRequest = e; -diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h -index fd7d69c..4d7ea96 100644 ---- a/src/plugins/platforms/xcb/qxcbwindow.h -+++ b/src/plugins/platforms/xcb/qxcbwindow.h -@@ -167,7 +167,6 @@ public: - - virtual void create(); - virtual void destroy(); -- void maybeSetScreen(QXcbScreen *screen); - QXcbScreen *screenForNativeGeometry(const QRect &newGeometry) const; - - public Q_SLOTS: --- -2.5.0 - diff --git a/sources b/sources index ecbcf83..a6a86ec 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -53ce29b757fec734085627cdf25f176f qtbase-opensource-src-5.6.0-beta.tar.gz +e5812c1aceef2f9be87999da70896032 qtbase-opensource-src-5.6.0-beta.tar.gz From 51f2110d6ae033e1b80939afc7a06375c5626dda Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Mon, 21 Dec 2015 12:10:33 -0600 Subject: [PATCH 24/62] fix/update Release: tag --- qt5-qtbase.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index e29afe6..e977900 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -39,7 +39,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.16%{?dist} +Release: 0.17.%{prerelease}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -863,6 +863,9 @@ fi %changelog +* Mon Dec 21 2015 Rex Dieter 5.6.0-0.17.beta +- fix/update Release: tag + * Fri Dec 18 2015 Rex Dieter 5.6.0-0.16 - 5.6.0-beta (final) From 23c5d626d9be66db0e8e60990a1d31c316d8f9f3 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Mon, 4 Jan 2016 12:17:07 -0600 Subject: [PATCH 25/62] Crash in QXcbWindow::setParent() due to NULL xcbScreen (QTBUG-50081, #1291003) --- ...because-of-NULL-screen-in-QXcbWindow.patch | 44 +++++++++++++++++++ qt5-qtbase.spec | 9 +++- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 0084-Fix-crash-because-of-NULL-screen-in-QXcbWindow.patch diff --git a/0084-Fix-crash-because-of-NULL-screen-in-QXcbWindow.patch b/0084-Fix-crash-because-of-NULL-screen-in-QXcbWindow.patch new file mode 100644 index 0000000..06ce865 --- /dev/null +++ b/0084-Fix-crash-because-of-NULL-screen-in-QXcbWindow.patch @@ -0,0 +1,44 @@ +From eaa3a9d0108cdf692f1686cafefb7b834f0e5af6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= +Date: Fri, 1 Jan 2016 20:02:42 +0100 +Subject: [PATCH 84/87] Fix crash because of NULL screen in QXcbWindow + +Change-Id: If7bbe3ad1656dadcb098bcd3ece2e7b064eeb44d +Task-number: QTBUG-50081 +Reviewed-by: Shawn Rutledge +--- + src/gui/kernel/qwindow.cpp | 14 ++++++-------- + 1 file changed, 6 insertions(+), 8 deletions(-) + +diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp +index e728d32..83e8777 100644 +--- a/src/gui/kernel/qwindow.cpp ++++ b/src/gui/kernel/qwindow.cpp +@@ -609,18 +609,16 @@ void QWindow::setParent(QWindow *parent) + } + + QObject::setParent(parent); +- if (parent) ++ ++ QPlatformWindow *parentPlatformWindow = parent ? parent->d_func()->platformWindow : Q_NULLPTR; ++ ++ if (parentPlatformWindow) + d->disconnectFromScreen(); + else + d->connectToScreen(newScreen); + +- if (d->platformWindow) { +- if (parent && parent->d_func()->platformWindow) { +- d->platformWindow->setParent(parent->d_func()->platformWindow); +- } else { +- d->platformWindow->setParent(0); +- } +- } ++ if (d->platformWindow) ++ d->platformWindow->setParent(parentPlatformWindow); + + d->parentWindow = parent; + +-- +2.5.0 + diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index e977900..ac9602a 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -39,7 +39,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.17.%{prerelease}%{?dist} +Release: 0.18.%{prerelease}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -91,6 +91,10 @@ Patch100: qtbase-opensource-src-5.4.0-QTBUG-43057.patch # https://codereview.qt-project.org/126102/ Patch150: moc-get-the-system-defines-from-the-compiler-itself.patch +# https://bugreports.qt.io/browse/QTBUG-50081 +# https://codereview.qt-project.org/#/c/144896/ +Patch184: 0084-Fix-crash-because-of-NULL-screen-in-QXcbWindow.patch + # macros, be mindful to keep sync'd with macros.qt5 Source10: macros.qt5 %define _qt5 %{name} @@ -863,6 +867,9 @@ fi %changelog +* Mon Jan 04 2016 Rex Dieter 5.6.0-0.18.beta +- Crash in QXcbWindow::setParent() due to NULL xcbScreen (QTBUG-50081, #1291003) + * Mon Dec 21 2015 Rex Dieter 5.6.0-0.17.beta - fix/update Release: tag From e25222eb9983fe450d3f5faf5f91c9705787eb4e Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Tue, 5 Jan 2016 10:09:21 -0600 Subject: [PATCH 26/62] actually apply patch for QXcbWindow::setParent --- qt5-qtbase.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index ac9602a..7fc480d 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -39,7 +39,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.18.%{prerelease}%{?dist} +Release: 0.19.%{prerelease}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -335,6 +335,7 @@ rm -fv mkspecs/linux-g++*/qmake.conf.multilib-optflags %endif %patch150 -p1 -b .moc_system_defines +%patch184 -p1 -b .0084 # drop -fexceptions from $RPM_OPT_FLAGS RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's|-fexceptions||g'` @@ -867,7 +868,7 @@ fi %changelog -* Mon Jan 04 2016 Rex Dieter 5.6.0-0.18.beta +* Mon Jan 04 2016 Rex Dieter 5.6.0-0.19.beta - Crash in QXcbWindow::setParent() due to NULL xcbScreen (QTBUG-50081, #1291003) * Mon Dec 21 2015 Rex Dieter 5.6.0-0.17.beta From 46be469a36ccac0deedc3aa37130096b19e8523c Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Tue, 12 Jan 2016 10:52:48 -0600 Subject: [PATCH 27/62] purge (unused) disconnect_displays.patch --- qt5-qtbase.spec | 5 ----- ...ensource-src-5.5-disconnect_displays.patch | 22 ------------------- 2 files changed, 27 deletions(-) delete mode 100644 qtbase-opensource-src-5.5-disconnect_displays.patch diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 7fc480d..2280d63 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -73,10 +73,6 @@ Patch12: qtbase-opensource-src-5.2.0-enable_ft_lcdfilter.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 - # Workaround moc/multilib issues # https://bugzilla.redhat.com/show_bug.cgi?id=1290020 # https://bugreports.qt.io/browse/QTBUG-49972 @@ -327,7 +323,6 @@ rm -fv mkspecs/linux-g++*/qmake.conf.multilib-optflags %patch4 -p1 -b .QTBUG-35459 %patch12 -p1 -b .enable_ft_lcdfilter -#patch51 -p1 -b .disconnect_displays %patch52 -p1 -b .moc_WORDSIZE %if 0%{?rhel} == 6 diff --git a/qtbase-opensource-src-5.5-disconnect_displays.patch b/qtbase-opensource-src-5.5-disconnect_displays.patch deleted file mode 100644 index 16b47d6..0000000 --- a/qtbase-opensource-src-5.5-disconnect_displays.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/src/gui/kernel/qwindow.cpp 2015-10-30 06:20:01.000000000 -0200 -+++ b/src/gui/kernel/qwindow.cpp 2015-11-05 11:31:10.544561171 -0200 -@@ -373,15 +373,14 @@ - 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); - } - } From 16f06bec965d40d15b0d3e4a583f45b78721b4a4 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Fri, 15 Jan 2016 17:47:35 +0100 Subject: [PATCH 28/62] enable -qt-xcb to fix non-US keys under VNC (#1295713) --- qt5-qtbase.spec | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 2280d63..a6585ba 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -39,7 +39,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.19.%{prerelease}%{?dist} +Release: 0.20.%{prerelease}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -154,6 +154,9 @@ BuildRequires: pkgconfig(xkbcommon) >= 0.4.1 BuildRequires: pkgconfig(xkbcommon-x11) >= 0.4.1 %else # not Fedora +%if 0%{?rhel} == 6 +%global xcb -qt-xcb +%endif %global xkbcommon -qt-xkbcommon Provides: bundled(libxkbcommon) = 0.4.1 %endif @@ -353,7 +356,10 @@ bin/syncqt.pl -version %{version} # move some bundled libs to ensure they're not accidentally used pushd src/3rdparty mkdir UNUSED -mv freetype libjpeg libpng zlib xcb sqlite UNUSED/ +mv freetype libjpeg libpng zlib sqlite UNUSED/ +%if "%{?xcb}" != "-qt-xcb" +mv xcb UNUSED/ +%endif popd # builds failing mysteriously on f20 @@ -407,6 +413,7 @@ test -x configure || chmod +x configure -system-sqlite \ %{?pcre} \ %{?tds} \ + %{?xcb} \ %{?xkbcommon} \ -system-zlib \ -no-directfb @@ -863,6 +870,9 @@ fi %changelog +* Fri Jan 15 2016 Than Ngo - 5.6.0-0.20.beta +- enable -qt-xcb to fix non-US keys under VNC (#1295713 + * Mon Jan 04 2016 Rex Dieter 5.6.0-0.19.beta - Crash in QXcbWindow::setParent() due to NULL xcbScreen (QTBUG-50081, #1291003) From 81cc5836adde956d366f8320751e5a31198df6c2 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Fri, 15 Jan 2016 11:16:10 -0600 Subject: [PATCH 29/62] typo --- qt5-qtbase.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index a6585ba..4d4b6b8 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -871,7 +871,7 @@ fi %changelog * Fri Jan 15 2016 Than Ngo - 5.6.0-0.20.beta -- enable -qt-xcb to fix non-US keys under VNC (#1295713 +- enable -qt-xcb to fix non-US keys under VNC (#1295713) * Mon Jan 04 2016 Rex Dieter 5.6.0-0.19.beta - Crash in QXcbWindow::setParent() due to NULL xcbScreen (QTBUG-50081, #1291003) From e13793651a199e63483ad73542e51001ac7f1e71 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Fri, 15 Jan 2016 12:27:05 -0600 Subject: [PATCH 30/62] drop el6 qdoc patch (qdoc moved to qttools) --- qt5-qtbase.spec | 7 ------- qtbase-opensource-src-5.4.0-QTBUG-43057.patch | 12 ------------ 2 files changed, 19 deletions(-) delete mode 100644 qtbase-opensource-src-5.4.0-QTBUG-43057.patch diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 4d4b6b8..3443c7c 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -79,9 +79,6 @@ Patch50: qt5-poll.patch Patch52: qtbase-opensource-src-5.6.0-moc_WORDSIZE.patch ## upstream patches -# workaround https://bugreports.qt-project.org/browse/QTBUG-43057 -# 'make docs' crash on el6, use qSort instead of std::sort -Patch100: qtbase-opensource-src-5.4.0-QTBUG-43057.patch # recently passed code review, not integrated yet # https://codereview.qt-project.org/126102/ @@ -328,10 +325,6 @@ rm -fv mkspecs/linux-g++*/qmake.conf.multilib-optflags %patch52 -p1 -b .moc_WORDSIZE -%if 0%{?rhel} == 6 -%patch100 -p1 -b .QTBUG-43057 -%endif - %patch150 -p1 -b .moc_system_defines %patch184 -p1 -b .0084 diff --git a/qtbase-opensource-src-5.4.0-QTBUG-43057.patch b/qtbase-opensource-src-5.4.0-QTBUG-43057.patch deleted file mode 100644 index 3281018..0000000 --- a/qtbase-opensource-src-5.4.0-QTBUG-43057.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up qtbase-opensource-src-5.4.0/src/tools/qdoc/qdocindexfiles.cpp.QTBUG-43057 qtbase-opensource-src-5.4.0/src/tools/qdoc/qdocindexfiles.cpp ---- qtbase-opensource-src-5.4.0/src/tools/qdoc/qdocindexfiles.cpp.QTBUG-43057 2014-12-05 10:24:31.000000000 -0600 -+++ qtbase-opensource-src-5.4.0/src/tools/qdoc/qdocindexfiles.cpp 2014-12-17 14:47:19.393037164 -0600 -@@ -1327,7 +1327,7 @@ void QDocIndexFiles::generateIndexSectio - const InnerNode* inner = static_cast(node); - - NodeList cnodes = inner->childNodes(); -- std::sort(cnodes.begin(), cnodes.end(), compareNodes); -+ qSort(cnodes.begin(), cnodes.end(), compareNodes); - - foreach (Node* child, cnodes) { - generateIndexSections(writer, child, generateInternalNodes); From 83771cef8ea12103a175d6a5dfc8c79fa72766cf Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Fri, 15 Jan 2016 14:36:30 -0600 Subject: [PATCH 31/62] allow for bundled harfbuzz,sqlite (el6) --- qt5-qtbase.spec | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 3443c7c..03ca807 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -164,7 +164,9 @@ BuildRequires: pkgconfig(atspi-2) BuildRequires: pkgconfig(egl) BuildRequires: pkgconfig(gbm) BuildRequires: pkgconfig(glesv2) +%global sqlite -system-sqlite BuildRequires: pkgconfig(sqlite3) >= 3.7 +%global harfbuzz -system-harfbuzz BuildRequires: pkgconfig(harfbuzz) >= 1.0.6 BuildRequires: pkgconfig(icu-i18n) BuildRequires: pkgconfig(libpcre) >= 8.30 @@ -349,7 +351,10 @@ bin/syncqt.pl -version %{version} # move some bundled libs to ensure they're not accidentally used pushd src/3rdparty mkdir UNUSED -mv freetype libjpeg libpng zlib sqlite UNUSED/ +mv freetype libjpeg libpng zlib UNUSED/ +%if "%{?sqlite}" == "-system-sqlite" +mv sqlite UNUSED/ +%endif %if "%{?xcb}" != "-qt-xcb" mv xcb UNUSED/ %endif @@ -400,11 +405,11 @@ test -x configure || chmod +x configure -no-sse2 \ %endif -no-strip \ - -system-harfbuzz \ -system-libjpeg \ -system-libpng \ - -system-sqlite \ + %{?harfbuzz} \ %{?pcre} \ + %{?sqlite} \ %{?tds} \ %{?xcb} \ %{?xkbcommon} \ From 2910dd3a3b0902869db6e2ee58fbe21b4e6e00a7 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Sun, 17 Jan 2016 21:01:25 -0600 Subject: [PATCH 32/62] %%license hack for el6 --- qt5-qtbase.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 03ca807..f39771a 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -578,7 +578,8 @@ fi %endif %files -%doc LICENSE.LGPL* LGPL_EXCEPTION.txt LICENSE.FDL +%{!?_licensedir:%global license %%doc} +%license LICENSE.LGPL* LGPL_EXCEPTION.txt LICENSE.FDL %if 0%{?qtchooser} %dir %{_sysconfdir}/xdg/qtchooser # not editable config files, so not using %%config here From 05bdff217970d956e31b1e308514fd301d318413 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Tue, 2 Feb 2016 12:52:02 -0600 Subject: [PATCH 33/62] build with and add to macros.qt5 flags: -fno-delete-null-pointer-checks --- macros.qt5 | 19 +++++++++++-------- qt5-qtbase.spec | 15 +++++++++++++-- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/macros.qt5 b/macros.qt5 index b8fb250..ff37ef0 100644 --- a/macros.qt5 +++ b/macros.qt5 @@ -18,13 +18,16 @@ %_qt5_sysconfdir %{_qt5_settingsdir} %_qt5_translationdir %{_datadir}/qt5/translations -%qmake_qt5 \ - %{_qt5_qmake} \\\ - QMAKE_CFLAGS_DEBUG="${CFLAGS:-%optflags}" \\\ - QMAKE_CFLAGS_RELEASE="${CFLAGS:-%optflags}" \\\ - QMAKE_CXXFLAGS_DEBUG="${CXXFLAGS:-%optflags}" \\\ - QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS:-%optflags}" \\\ - QMAKE_LFLAGS_DEBUG="${LDFLAGS:-%{?__global_ldflags}}" \\\ - QMAKE_LFLAGS_RELEASE="${LDFLAGS:-%{?__global_ldflags}}" \\\ +%_qt5_ldflags %{?__global_ldflags} @@QT5_RPM_LD_FLAGS@ +%_qt5_optflags %{optflags} @@QT5_RPM_OPT_FLAGS@@ + +%_qt5_qmake_flags \\\ + QMAKE_CFLAGS_DEBUG="${CFLAGS:-%{_qt5_optflags}}" \\\ + QMAKE_CFLAGS_RELEASE="${CFLAGS:-%{_qt5_optflags}}" \\\ + QMAKE_CXXFLAGS_DEBUG="${CXXFLAGS:-%{_qt5_optflags}}" \\\ + QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS:-%{_qt5_optflags}}" \\\ + QMAKE_LFLAGS_DEBUG="${LDFLAGS:-%{_qt5_ldflags}}" \\\ + QMAKE_LFLAGS_RELEASE="${LDFLAGS:-%{_qt5_ldflags}}" \\\ QMAKE_STRIP= +%qmake_qt5 %{_qt5_qmake} %{?_qt5_qmake_flags} diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index f39771a..4dfe7e7 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -39,7 +39,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.20.%{prerelease}%{?dist} +Release: 0.21.%{prerelease}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -330,8 +330,14 @@ rm -fv mkspecs/linux-g++*/qmake.conf.multilib-optflags %patch150 -p1 -b .moc_system_defines %patch184 -p1 -b .0084 -# drop -fexceptions from $RPM_OPT_FLAGS +## adjust $RPM_OPT_FLAGS +# remove -fexceptions RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's|-fexceptions||g'` +# add -fno-delete-null-pointer-checks for f24/gcc6 +%if 0%{?fedora} > 23 +QT5_RPM_OPT_FLAGS="-fno-delete-null-pointer-checks" +RPM_OPT_FLAGS="$RPM_OPT_FLAGS $QT5_RPM_OPT_FLAGS" +%endif %define platform linux-g++ @@ -468,6 +474,8 @@ sed -i \ -e "s|@@EPOCH@@|%{?epoch}%{!?epoch:0}|g" \ -e "s|@@VERSION@@|%{version}|g" \ -e "s|@@EVR@@|%{?epoch:%{epoch:}}%{version}-%{release}|g" \ + -e "s|@@QT5_RPM_LD_FLAGS@@|$QT5_RPM_LD_FLAGS|g" \ + -e "s|@@QT5_RPM_OPT_FLAGS@@|$QT5_RPM_OPT_FLAGS|g" \ %{buildroot}%{rpm_macros_dir}/macros.qt5 # create/own dirs @@ -869,6 +877,9 @@ fi %changelog +* Tue Feb 02 2016 Rex Dieter 5.6.0-0.21.beta +- build with and add to macros.qt5 flags: -fno-delete-null-pointer-checks + * Fri Jan 15 2016 Than Ngo - 5.6.0-0.20.beta - enable -qt-xcb to fix non-US keys under VNC (#1295713) From 18dbf0cfc3e9a89a50331efd3f8994b5ca43ce0d Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Tue, 2 Feb 2016 16:00:23 -0600 Subject: [PATCH 34/62] don't inject $RPM_OPT_FLAGS/$RPM_LD_FLAGS into qmake defaults f24+ (#1279265) --- qt5-qtbase.spec | 47 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 4dfe7e7..ae5e42d 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -23,6 +23,11 @@ %global qt_settings 1 %endif +# See http://bugzilla.redhat.com/1279265 +%if 0%{?fedora} < 24 +%global inject_optflags 1 +%endif + # define to build docs, need to undef this for bootstrapping # where qt5-qttools builds are not yet available # only primary archs (for now), allow secondary to bootstrap @@ -39,7 +44,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.21.%{prerelease}%{?dist} +Release: 0.22.%{prerelease}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -223,11 +228,10 @@ Requires: %{name}-gui%{?_isa} Requires: pkgconfig(egl) %endif Requires: pkgconfig(gl) -%if 0%{?fedora} > 22 +%if 0%{?fedora} > 22 && 0%{?inject_optflags} # https://bugzilla.redhat.com/show_bug.cgi?id=1248174 Requires: redhat-rpm-config %endif - %description devel %{summary}. @@ -318,10 +322,6 @@ Qt5 libraries used for drawing widgets and OpenGL items. %prep %setup -q -n %{qt_module}-opensource-src-%{version}%{?prerelease:-%{prerelease}} -%patch2 -p1 -b .multilib_optflags -# drop backup file(s), else they get installed too, http://bugzilla.redhat.com/639463 -rm -fv mkspecs/linux-g++*/qmake.conf.multilib-optflags - %patch4 -p1 -b .QTBUG-35459 %patch12 -p1 -b .enable_ft_lcdfilter @@ -341,6 +341,11 @@ RPM_OPT_FLAGS="$RPM_OPT_FLAGS $QT5_RPM_OPT_FLAGS" %define platform linux-g++ +%if 0%{?inject_optflags} +%patch2 -p1 -b .multilib_optflags +# drop backup file(s), else they get installed too, http://bugzilla.redhat.com/639463 +rm -fv mkspecs/linux-g++*/qmake.conf.multilib-optflags + sed -i -e "s|-O2|$RPM_OPT_FLAGS|g" \ mkspecs/%{platform}/qmake.conf @@ -349,6 +354,7 @@ sed -i -e "s|^\(QMAKE_LFLAGS_RELEASE.*\)|\1 $RPM_LD_FLAGS|" \ # undefine QMAKE_STRIP (and friends), so we get useful -debuginfo pkgs (#1065636) sed -i -e 's|^\(QMAKE_STRIP.*=\).*$|\1|g' mkspecs/common/linux.conf +%endif %if %{prerelease} bin/syncqt.pl -version %{version} @@ -373,6 +379,20 @@ test -x configure || chmod +x configure %build +## adjust $RPM_OPT_FLAGS +# remove -fexceptions +RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's|-fexceptions||g'` +# add -fno-delete-null-pointer-checks for f24/gcc6 +%if 0%{?fedora} > 23 +QT5_RPM_OPT_FLAGS="-fno-delete-null-pointer-checks" +RPM_OPT_FLAGS="$RPM_OPT_FLAGS $QT5_RPM_OPT_FLAGS" +%endif + +export CFLAGS="$CFLAGS $RPM_OPT_FLAGS" +export CXXFLAGS="$CXXFLAGS $RPM_OPT_FLAGS" +export LDFLAGS="$LDFLAGS $RPM_LD_FLAGS" +export MAKEFLAGS="%{?_smp_mflags}" + ./configure -v \ -confirm-license \ -opensource \ @@ -422,6 +442,16 @@ test -x configure || chmod +x configure -system-zlib \ -no-directfb +%if ! 0%{?inject_optflags} +# ensure qmake build using optflags (which can happen if not munging qmake.conf defaults) +make clean -C qmake +make %{?_smp_mflags} -C qmake \ + QMAKE_CFLAGS_RELEASE="${CFLAGS:-$RPM_OPT_FLAGS}" \ + QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS:-$RPM_OPT_FLAGS}" \ + QMAKE_LFLAGS_RELEASE="${LDFLAGS:-$RPM_LD_FLAGS}" \ + QMAKE_STRIP= +%endif + make %{?_smp_mflags} %if 0%{?docs} @@ -877,6 +907,9 @@ fi %changelog +* Tue Feb 02 2016 Rex Dieter 5.6.0-0.22.beta +- - don't inject $RPM_OPT_FLAGS/$RPM_LD_FLAGS into qmake defaults f24+ (#1279265) + * Tue Feb 02 2016 Rex Dieter 5.6.0-0.21.beta - build with and add to macros.qt5 flags: -fno-delete-null-pointer-checks From d4e18227d7a00d5d92aec9bb976a4e8787f0e746 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Wed, 3 Feb 2016 10:21:01 -0600 Subject: [PATCH 35/62] qt5-rpm-macros pkg --- qt5-qtbase.spec | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index ae5e42d..a30a2be 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -44,7 +44,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.22.%{prerelease}%{?dist} +Release: 0.23.%{prerelease}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -228,10 +228,7 @@ Requires: %{name}-gui%{?_isa} Requires: pkgconfig(egl) %endif Requires: pkgconfig(gl) -%if 0%{?fedora} > 22 && 0%{?inject_optflags} -# https://bugzilla.redhat.com/show_bug.cgi?id=1248174 -Requires: redhat-rpm-config -%endif +Requires: qt5-rpm-macros %description devel %{summary}. @@ -310,14 +307,24 @@ Recommends: mesa-dri-drivers %endif Obsoletes: qt5-qtbase-x11 < 5.2.0 Provides: qt5-qtbase-x11 = %{version}-%{release} - # for Source6: 10-qt5-check-opengl2.sh: # glxinfo Requires: glx-utils - %description gui Qt5 libraries used for drawing widgets and OpenGL items. +%package -n qt5-rpm-macros +Summary: RPM macros for Qt5 +%if 0%{?fedora} > 22 && 0%{?inject_optflags} +# https://bugzilla.redhat.com/show_bug.cgi?id=1248174 +Requires: redhat-rpm-config +%endif +# when qt5-rpm-macros was split out +Conflicts: qt5-qtbase-devel < 5.6.0-0.23 +BuildArch: noarch +%description -n qt5-rpm-macros +RPM macros for building Qt5 packages. + %prep %setup -q -n %{qt_module}-opensource-src-%{version}%{?prerelease:-%{prerelease}} @@ -703,7 +710,6 @@ fi %endif %files devel -%{rpm_macros_dir}/macros.qt5 %if "%{_qt5_bindir}" != "%{_bindir}" %dir %{_qt5_bindir} %endif @@ -905,10 +911,16 @@ fi %{_qt5_plugindir}/printsupport/libcupsprintersupport.so %{_qt5_libdir}/cmake/Qt5PrintSupport/Qt5PrintSupport_QCupsPrinterSupportPlugin.cmake +%files -n qt5-rpm-macros +%{rpm_macros_dir}/macros.qt5 + %changelog +* Wed Feb 03 2016 Rex Dieter 5.6.0-0.23.beta +- qt5-rpm-macros pkg + * Tue Feb 02 2016 Rex Dieter 5.6.0-0.22.beta -- - don't inject $RPM_OPT_FLAGS/$RPM_LD_FLAGS into qmake defaults f24+ (#1279265) +- don't inject $RPM_OPT_FLAGS/$RPM_LD_FLAGS into qmake defaults f24+ (#1279265) * Tue Feb 02 2016 Rex Dieter 5.6.0-0.21.beta - build with and add to macros.qt5 flags: -fno-delete-null-pointer-checks From 4334573c9404967bbf697d79d138656b5d8bbfa7 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Thu, 11 Feb 2016 13:35:11 +0100 Subject: [PATCH 36/62] - fix build issue with gcc6 - fix check for alsa 1.1.x --- qt5-qtbase.spec | 14 +++++++++++--- qtbase-opensource-src-5.6.0-alsa-1.1.patch | 12 ++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 qtbase-opensource-src-5.6.0-alsa-1.1.patch diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index a30a2be..5a9c7ee 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -44,7 +44,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.23.%{prerelease}%{?dist} +Release: 0.24.%{prerelease}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -83,6 +83,9 @@ Patch50: qt5-poll.patch # https://bugreports.qt.io/browse/QTBUG-49972 Patch52: qtbase-opensource-src-5.6.0-moc_WORDSIZE.patch +# correct check for alsa-1.1 +Patch53: qtbase-opensource-src-5.6.0-alsa-1.1.patch + ## upstream patches # recently passed code review, not integrated yet @@ -333,6 +336,7 @@ RPM macros for building Qt5 packages. %patch12 -p1 -b .enable_ft_lcdfilter %patch52 -p1 -b .moc_WORDSIZE +%patch53 -p1 -b .alsa1.1 %patch150 -p1 -b .moc_system_defines %patch184 -p1 -b .0084 @@ -342,7 +346,7 @@ RPM macros for building Qt5 packages. RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's|-fexceptions||g'` # add -fno-delete-null-pointer-checks for f24/gcc6 %if 0%{?fedora} > 23 -QT5_RPM_OPT_FLAGS="-fno-delete-null-pointer-checks" +QT5_RPM_OPT_FLAGS="-fno-delete-null-pointer-checks -std=gnu++11" RPM_OPT_FLAGS="$RPM_OPT_FLAGS $QT5_RPM_OPT_FLAGS" %endif @@ -391,7 +395,7 @@ test -x configure || chmod +x configure RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's|-fexceptions||g'` # add -fno-delete-null-pointer-checks for f24/gcc6 %if 0%{?fedora} > 23 -QT5_RPM_OPT_FLAGS="-fno-delete-null-pointer-checks" +QT5_RPM_OPT_FLAGS="-fno-delete-null-pointer-checks -std=gnu++11" RPM_OPT_FLAGS="$RPM_OPT_FLAGS $QT5_RPM_OPT_FLAGS" %endif @@ -916,6 +920,10 @@ fi %changelog +* Thu Feb 11 2016 Than Ngo - 5.6.0-0.24.beta +- fix build issue with gcc6 +- fix check for alsa 1.1.x + * Wed Feb 03 2016 Rex Dieter 5.6.0-0.23.beta - qt5-rpm-macros pkg diff --git a/qtbase-opensource-src-5.6.0-alsa-1.1.patch b/qtbase-opensource-src-5.6.0-alsa-1.1.patch new file mode 100644 index 0000000..566287d --- /dev/null +++ b/qtbase-opensource-src-5.6.0-alsa-1.1.patch @@ -0,0 +1,12 @@ +diff -up qtbase-opensource-src-5.6.0-beta/config.tests/unix/alsa/alsatest.cpp.than qtbase-opensource-src-5.6.0-beta/config.tests/unix/alsa/alsatest.cpp +--- qtbase-opensource-src-5.6.0-beta/config.tests/unix/alsa/alsatest.cpp.than 2015-12-14 21:49:46.000000000 +0100 ++++ qtbase-opensource-src-5.6.0-beta/config.tests/unix/alsa/alsatest.cpp 2016-02-11 13:29:59.249275394 +0100 +@@ -32,7 +32,7 @@ + ****************************************************************************/ + + #include +-#if(!(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 10)) ++#if(!(SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || SND_LIB_SUBMINOR >= 10))) + #error "Alsa version found too old, require >= 1.0.10" + #endif + From d7211d621e0424d2f0dcd98e16ec4eced0970f47 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Fri, 12 Feb 2016 16:17:34 +0100 Subject: [PATCH 37/62] enable support neon on arm, as it's supported from hardware --- qt5-qtbase.spec | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 5a9c7ee..28a3a57 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -86,6 +86,9 @@ Patch52: qtbase-opensource-src-5.6.0-moc_WORDSIZE.patch # correct check for alsa-1.1 Patch53: qtbase-opensource-src-5.6.0-alsa-1.1.patch +# arm patch +Patch54: qtbase-opensource-src-5.6.0-arm.patch + ## upstream patches # recently passed code review, not integrated yet @@ -337,6 +340,7 @@ RPM macros for building Qt5 packages. %patch52 -p1 -b .moc_WORDSIZE %patch53 -p1 -b .alsa1.1 +%patch54 -p1 -b .arm %patch150 -p1 -b .moc_system_defines %patch184 -p1 -b .0084 @@ -346,8 +350,11 @@ RPM macros for building Qt5 packages. RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's|-fexceptions||g'` # add -fno-delete-null-pointer-checks for f24/gcc6 %if 0%{?fedora} > 23 -QT5_RPM_OPT_FLAGS="-fno-delete-null-pointer-checks -std=gnu++11" +QT5_RPM_OPT_FLAGS="-fno-delete-null-pointer-checks" RPM_OPT_FLAGS="$RPM_OPT_FLAGS $QT5_RPM_OPT_FLAGS" +%ifarch armv7hl +RPM_OPT_FLAGS="$RPM_OPT_FLAGS -mfpu=neon" +%endif %endif %define platform linux-g++ @@ -395,8 +402,11 @@ test -x configure || chmod +x configure RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's|-fexceptions||g'` # add -fno-delete-null-pointer-checks for f24/gcc6 %if 0%{?fedora} > 23 -QT5_RPM_OPT_FLAGS="-fno-delete-null-pointer-checks -std=gnu++11" +QT5_RPM_OPT_FLAGS="-fno-delete-null-pointer-checks" RPM_OPT_FLAGS="$RPM_OPT_FLAGS $QT5_RPM_OPT_FLAGS" +%ifarch armv7hl +RPM_OPT_FLAGS="$RPM_OPT_FLAGS -mfpu=neon" +%endif %endif export CFLAGS="$CFLAGS $RPM_OPT_FLAGS" From 1d4447d07379cef1259cc4a78ae23f97bb9b7f09 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Fri, 12 Feb 2016 16:19:23 +0100 Subject: [PATCH 38/62] add missing patch --- qtbase-opensource-src-5.6.0-arm.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 qtbase-opensource-src-5.6.0-arm.patch diff --git a/qtbase-opensource-src-5.6.0-arm.patch b/qtbase-opensource-src-5.6.0-arm.patch new file mode 100644 index 0000000..63df719 --- /dev/null +++ b/qtbase-opensource-src-5.6.0-arm.patch @@ -0,0 +1,13 @@ +diff -up qtbase-opensource-src-5.6.0-beta/configure.than qtbase-opensource-src-5.6.0-beta/configure +--- qtbase-opensource-src-5.6.0-beta/configure.than 2016-02-12 13:56:20.057741037 +0100 ++++ qtbase-opensource-src-5.6.0-beta/configure 2016-02-12 14:10:10.267768256 +0100 +@@ -4346,6 +4346,9 @@ if [ "$QMAKESPEC" != "$XQMAKESPEC" ]; th + else + # not cross compiling, host == target + CFG_HOST_ARCH="$CFG_ARCH" ++ if [ "$CFG_ARCH" = "arm" ] ; then ++ CFG_CPUFEATURES="neon" ++ fi + CFG_HOST_CPUFEATURES="$CFG_CPUFEATURES" + fi + unset OUTFILE From 8f4e73873a143dcfdd24ea1d41d9c4a4bd7c76f1 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Sat, 13 Feb 2016 06:55:22 -0600 Subject: [PATCH 39/62] macros.qt5: fix %qt5_ldflags macro --- macros.qt5 | 2 +- qt5-qtbase.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/macros.qt5 b/macros.qt5 index ff37ef0..ee9b259 100644 --- a/macros.qt5 +++ b/macros.qt5 @@ -18,7 +18,7 @@ %_qt5_sysconfdir %{_qt5_settingsdir} %_qt5_translationdir %{_datadir}/qt5/translations -%_qt5_ldflags %{?__global_ldflags} @@QT5_RPM_LD_FLAGS@ +%_qt5_ldflags %{?__global_ldflags} @@QT5_RPM_LD_FLAGS@@ %_qt5_optflags %{optflags} @@QT5_RPM_OPT_FLAGS@@ %_qt5_qmake_flags \\\ diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 28a3a57..a7bc436 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -44,7 +44,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.24.%{prerelease}%{?dist} +Release: 0.25.%{prerelease}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -930,6 +930,9 @@ fi %changelog +* Sat Feb 13 2016 Rex Dieter 5.6.0-0.25.beta +- macros.qt5: fix %%qt5_ldflags macro + * Thu Feb 11 2016 Than Ngo - 5.6.0-0.24.beta - fix build issue with gcc6 - fix check for alsa 1.1.x From dc005de05ebde43b318d4cbbf52f0ca9cfde23c5 Mon Sep 17 00:00:00 2001 From: Helio Chissini de Castro Date: Mon, 15 Feb 2016 10:48:41 +0100 Subject: [PATCH 40/62] - Update rc packages --- .gitignore | 1 + ...because-of-NULL-screen-in-QXcbWindow.patch | 44 ------------------- qt5-qtbase.spec | 16 +++---- sources | 2 +- 4 files changed, 9 insertions(+), 54 deletions(-) delete mode 100644 0084-Fix-crash-because-of-NULL-screen-in-QXcbWindow.patch diff --git a/.gitignore b/.gitignore index d1fab2c..9450c8b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /qtbase-opensource-src-5.5.1.tar.xz /qtbase-opensource-src-5.6.0-beta.tar.gz +/qtbase-opensource-src-5.6.0-rc.tar.xz diff --git a/0084-Fix-crash-because-of-NULL-screen-in-QXcbWindow.patch b/0084-Fix-crash-because-of-NULL-screen-in-QXcbWindow.patch deleted file mode 100644 index 06ce865..0000000 --- a/0084-Fix-crash-because-of-NULL-screen-in-QXcbWindow.patch +++ /dev/null @@ -1,44 +0,0 @@ -From eaa3a9d0108cdf692f1686cafefb7b834f0e5af6 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= -Date: Fri, 1 Jan 2016 20:02:42 +0100 -Subject: [PATCH 84/87] Fix crash because of NULL screen in QXcbWindow - -Change-Id: If7bbe3ad1656dadcb098bcd3ece2e7b064eeb44d -Task-number: QTBUG-50081 -Reviewed-by: Shawn Rutledge ---- - src/gui/kernel/qwindow.cpp | 14 ++++++-------- - 1 file changed, 6 insertions(+), 8 deletions(-) - -diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp -index e728d32..83e8777 100644 ---- a/src/gui/kernel/qwindow.cpp -+++ b/src/gui/kernel/qwindow.cpp -@@ -609,18 +609,16 @@ void QWindow::setParent(QWindow *parent) - } - - QObject::setParent(parent); -- if (parent) -+ -+ QPlatformWindow *parentPlatformWindow = parent ? parent->d_func()->platformWindow : Q_NULLPTR; -+ -+ if (parentPlatformWindow) - d->disconnectFromScreen(); - else - d->connectToScreen(newScreen); - -- if (d->platformWindow) { -- if (parent && parent->d_func()->platformWindow) { -- d->platformWindow->setParent(parent->d_func()->platformWindow); -- } else { -- d->platformWindow->setParent(0); -- } -- } -+ if (d->platformWindow) -+ d->platformWindow->setParent(parentPlatformWindow); - - d->parentWindow = parent; - --- -2.5.0 - diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index a7bc436..8a0a8f3 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -39,20 +39,20 @@ %define examples 1 -%define prerelease beta +%define prerelease rc Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.25.%{prerelease}%{?dist} +Release: 0.26.%{prerelease}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions Url: http://qt-project.org/ %if 0%{?prerelease:1} -Source0: http://download.qt.io/development_releases/qt/5.6/%{version}-%{prerelease}/submodules/%{qt_module}-opensource-src-%{version}-%{prerelease}.tar.gz +Source0: http://download.qt.io/development_releases/qt/5.6/%{version}-%{prerelease}/submodules/%{qt_module}-opensource-src-%{version}-%{prerelease}.tar.xz %else -Source0: http://download.qt.io/official_releases/qt/5.6/%{version}%{?prerelease:-%{prerelease}}/submodules/%{qt_module}-opensource-src-%{version}%{?prerelease:-%{prerelease}}.tar.gz +Source0: http://download.qt.io/official_releases/qt/5.6/%{version}%{?prerelease:-%{prerelease}}/submodules/%{qt_module}-opensource-src-%{version}%{?prerelease:-%{prerelease}}.tar.xz %endif # header file to workaround multilib issue @@ -95,10 +95,6 @@ Patch54: qtbase-opensource-src-5.6.0-arm.patch # https://codereview.qt-project.org/126102/ Patch150: moc-get-the-system-defines-from-the-compiler-itself.patch -# https://bugreports.qt.io/browse/QTBUG-50081 -# https://codereview.qt-project.org/#/c/144896/ -Patch184: 0084-Fix-crash-because-of-NULL-screen-in-QXcbWindow.patch - # macros, be mindful to keep sync'd with macros.qt5 Source10: macros.qt5 %define _qt5 %{name} @@ -343,7 +339,6 @@ RPM macros for building Qt5 packages. %patch54 -p1 -b .arm %patch150 -p1 -b .moc_system_defines -%patch184 -p1 -b .0084 ## adjust $RPM_OPT_FLAGS # remove -fexceptions @@ -930,6 +925,9 @@ fi %changelog +* Mon Feb 15 2016 Helio Chissini de Castro - 5.6.0-0.26.rc +- Integrate rc releases now. + * Sat Feb 13 2016 Rex Dieter 5.6.0-0.25.beta - macros.qt5: fix %%qt5_ldflags macro diff --git a/sources b/sources index a6a86ec..600c9b7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -e5812c1aceef2f9be87999da70896032 qtbase-opensource-src-5.6.0-beta.tar.gz +d7c3bd870442ef3b169aa1eb939ae3a1 qtbase-opensource-src-5.6.0-rc.tar.xz From da8d87f7f1fdc22c6ff0b58e752355368260f077 Mon Sep 17 00:00:00 2001 From: Helio Chissini de Castro Date: Mon, 15 Feb 2016 12:46:44 +0100 Subject: [PATCH 41/62] - Add el6 sqrt patch --- qt5-qtbase-5.6.0-el6-sqrt.patch | 10 ++++++++++ qt5-qtbase.spec | 7 +++++++ 2 files changed, 17 insertions(+) create mode 100644 qt5-qtbase-5.6.0-el6-sqrt.patch diff --git a/qt5-qtbase-5.6.0-el6-sqrt.patch b/qt5-qtbase-5.6.0-el6-sqrt.patch new file mode 100644 index 0000000..e513a82 --- /dev/null +++ b/qt5-qtbase-5.6.0-el6-sqrt.patch @@ -0,0 +1,10 @@ +--- qtbase-opensource-src-5.6.0-rc/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp.orig 2016-02-15 11:27:10.714918086 +0100 ++++ qtbase-opensource-src-5.6.0-rc/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp 2016-02-15 11:52:11.843978315 +0100 +@@ -38,6 +38,7 @@ + #include "qtouchdevice.h" + #include + #include ++#include + + #ifdef XCB_USE_XINPUT2 + diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 8a0a8f3..e953b38 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -89,6 +89,9 @@ Patch53: qtbase-opensource-src-5.6.0-alsa-1.1.patch # arm patch Patch54: qtbase-opensource-src-5.6.0-arm.patch +# Epel patches +Patch100: qt5-qtbase-5.6.0-el6-sqrt.patch + ## upstream patches # recently passed code review, not integrated yet @@ -338,6 +341,10 @@ RPM macros for building Qt5 packages. %patch53 -p1 -b .alsa1.1 %patch54 -p1 -b .arm +%if 0%{?rhel} == 6 +%patch100 -p1 -b .sqrt +%endif + %patch150 -p1 -b .moc_system_defines ## adjust $RPM_OPT_FLAGS From 07c53f1b653f335845ae70d718e563ca33bf2071 Mon Sep 17 00:00:00 2001 From: Helio Chissini de Castro Date: Mon, 15 Feb 2016 13:41:57 +0100 Subject: [PATCH 42/62] - Update tarball package --- .gitignore | 1 + qt5-qtbase.spec | 5 ++++- sources | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 9450c8b..db121f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /qtbase-opensource-src-5.5.1.tar.xz /qtbase-opensource-src-5.6.0-beta.tar.gz /qtbase-opensource-src-5.6.0-rc.tar.xz +/sources diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index e953b38..35096c3 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -44,7 +44,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.26.%{prerelease}%{?dist} +Release: 0.27.%{prerelease}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -932,6 +932,9 @@ fi %changelog +* Mon Feb 15 2016 Helio Chissini de Castro - 5.6.0-0.27.rc +- Update proper tarball. Need avoid the fix branch + * Mon Feb 15 2016 Helio Chissini de Castro - 5.6.0-0.26.rc - Integrate rc releases now. diff --git a/sources b/sources index 600c9b7..568baae 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -d7c3bd870442ef3b169aa1eb939ae3a1 qtbase-opensource-src-5.6.0-rc.tar.xz +448c461b1d8ebbf2c783fb36a7a11ffe sources +8e7fc2a6cd7867f505bd0c1ba126739c qtbase-opensource-src-5.6.0-rc.tar.xz From f746e0497d1df1c51804933387d003ce339898a9 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Wed, 17 Feb 2016 16:54:27 +0100 Subject: [PATCH 43/62] fix build issue with gcc6 --- qt5-qtbase.spec | 7 +++++-- sources | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 35096c3..a4b7cd4 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -44,7 +44,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.27.%{prerelease}%{?dist} +Release: 0.28.%{prerelease}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -352,7 +352,7 @@ RPM macros for building Qt5 packages. RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's|-fexceptions||g'` # add -fno-delete-null-pointer-checks for f24/gcc6 %if 0%{?fedora} > 23 -QT5_RPM_OPT_FLAGS="-fno-delete-null-pointer-checks" +QT5_RPM_OPT_FLAGS="-fno-delete-null-pointer-checks -Wno-deprecated-declaration" RPM_OPT_FLAGS="$RPM_OPT_FLAGS $QT5_RPM_OPT_FLAGS" %ifarch armv7hl RPM_OPT_FLAGS="$RPM_OPT_FLAGS -mfpu=neon" @@ -932,6 +932,9 @@ fi %changelog +* Wed Feb 17 2016 Than Ngo - 5.6.0-0.28.rc +- fix build issue with gcc6 + * Mon Feb 15 2016 Helio Chissini de Castro - 5.6.0-0.27.rc - Update proper tarball. Need avoid the fix branch diff --git a/sources b/sources index 568baae..600c9b7 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -448c461b1d8ebbf2c783fb36a7a11ffe sources -8e7fc2a6cd7867f505bd0c1ba126739c qtbase-opensource-src-5.6.0-rc.tar.xz +d7c3bd870442ef3b169aa1eb939ae3a1 qtbase-opensource-src-5.6.0-rc.tar.xz From c193d1a95f3c3e0f9e14f76364d0331cb6834e72 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Wed, 17 Feb 2016 20:35:18 +0100 Subject: [PATCH 44/62] fix build failure with gcc6 --- qt5-qtbase.spec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index a4b7cd4..9fca49b 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -341,9 +341,7 @@ RPM macros for building Qt5 packages. %patch53 -p1 -b .alsa1.1 %patch54 -p1 -b .arm -%if 0%{?rhel} == 6 %patch100 -p1 -b .sqrt -%endif %patch150 -p1 -b .moc_system_defines @@ -404,7 +402,7 @@ test -x configure || chmod +x configure RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's|-fexceptions||g'` # add -fno-delete-null-pointer-checks for f24/gcc6 %if 0%{?fedora} > 23 -QT5_RPM_OPT_FLAGS="-fno-delete-null-pointer-checks" +QT5_RPM_OPT_FLAGS="-fno-delete-null-pointer-checks -Wno-deprecated-declaration" RPM_OPT_FLAGS="$RPM_OPT_FLAGS $QT5_RPM_OPT_FLAGS" %ifarch armv7hl RPM_OPT_FLAGS="$RPM_OPT_FLAGS -mfpu=neon" From 49036c6ceae49dfaf69f7bd1523c7cc38bb37b7f Mon Sep 17 00:00:00 2001 From: Helio Chissini de Castro Date: Fri, 19 Feb 2016 18:07:07 +0100 Subject: [PATCH 45/62] - Updated tarball --- qt5-qtbase.spec | 5 ++++- sources | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 35096c3..faf95d9 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -44,7 +44,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.27.%{prerelease}%{?dist} +Release: 0.28.%{prerelease}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -932,6 +932,9 @@ fi %changelog +* Fri Feb 19 2016 Helio Chissini de Castro - 5.6.0-0.28.rc +- Update tarball with https://bugreports.qt.io/browse/QTBUG-50703 fix + * Mon Feb 15 2016 Helio Chissini de Castro - 5.6.0-0.27.rc - Update proper tarball. Need avoid the fix branch diff --git a/sources b/sources index 568baae..726f17a 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -448c461b1d8ebbf2c783fb36a7a11ffe sources -8e7fc2a6cd7867f505bd0c1ba126739c qtbase-opensource-src-5.6.0-rc.tar.xz +4d73280e06e4f7da687d396059fced12 qtbase-opensource-src-5.6.0-rc.tar.xz From 9977eae8bcf9426c79fb07d4b871cb63e57e3bdd Mon Sep 17 00:00:00 2001 From: Helio Chissini de Castro Date: Tue, 23 Feb 2016 16:33:42 +0100 Subject: [PATCH 46/62] Update final RC --- qt5-qtbase.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 9c9c6ff..16105bf 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -44,7 +44,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.29.%{prerelease}%{?dist} +Release: 0.30.%{prerelease}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -930,6 +930,9 @@ fi %changelog +* Tue Feb 23 2016 Helio Chissini de Castro - 5.6.0-0.30.rc +- Update to final RC + * Mon Feb 22 2016 Helio Chissini de Castro - 5.6.0-0.29.rc - Update tarball with https://bugreports.qt.io/browse/QTBUG-50703 fix diff --git a/sources b/sources index 726f17a..cbd1b52 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -4d73280e06e4f7da687d396059fced12 qtbase-opensource-src-5.6.0-rc.tar.xz +82e5bd59946630ec36ab357f1779f411 qtbase-opensource-src-5.6.0-rc.tar.xz From e52638b34596ee8fdc00dd16826e99598d60003a Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Wed, 24 Feb 2016 21:47:20 -0600 Subject: [PATCH 47/62] Item views don't handle insert/remove of rows robustly (QTBUG-48870) --- ...-skipping-indexes-in-selectedIndexes.patch | 78 +++++++++++++++++++ qt5-qtbase.spec | 9 ++- 2 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 0076-QListView-fix-skipping-indexes-in-selectedIndexes.patch diff --git a/0076-QListView-fix-skipping-indexes-in-selectedIndexes.patch b/0076-QListView-fix-skipping-indexes-in-selectedIndexes.patch new file mode 100644 index 0000000..95fb7c4 --- /dev/null +++ b/0076-QListView-fix-skipping-indexes-in-selectedIndexes.patch @@ -0,0 +1,78 @@ +From a3b8e355fc17783a5d4badfb9ad50247655000cd Mon Sep 17 00:00:00 2001 +From: Anton Kudryavtsev +Date: Fri, 12 Feb 2016 15:31:07 +0300 +Subject: [PATCH 076/122] QListView: fix skipping indexes in selectedIndexes(). + +Remove spurious increment of i. + +Task-number: QTBUG-51086 +Change-Id: I4307a6728de1e7f25c8afa31fe2066f92373f3fc +Reviewed-by: Edward Welbourne +Reviewed-by: Oswald Buddenhagen +Reviewed-by: Marc Mutz +--- + src/widgets/itemviews/qlistview.cpp | 2 +- + .../widgets/itemviews/qlistview/tst_qlistview.cpp | 28 ++++++++++++++++++++++ + 2 files changed, 29 insertions(+), 1 deletion(-) + +diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp +index 9c79509..a17d89e 100644 +--- a/src/widgets/itemviews/qlistview.cpp ++++ b/src/widgets/itemviews/qlistview.cpp +@@ -1437,7 +1437,7 @@ QModelIndexList QListView::selectedIndexes() const + return QModelIndexList(); + + QModelIndexList viewSelected = d->selectionModel->selectedIndexes(); +- for (int i = 0; i < viewSelected.count(); ++i) { ++ for (int i = 0; i < viewSelected.count();) { + const QModelIndex &index = viewSelected.at(i); + if (!isIndexHidden(index) && index.parent() == d->root && index.column() == d->column) + ++i; +diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp +index 5b206af..3cf9f7f 100644 +--- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp ++++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp +@@ -152,6 +152,7 @@ private slots: + void taskQTBUG_39902_mutualScrollBars_data(); + void taskQTBUG_39902_mutualScrollBars(); + void horizontalScrollingByVerticalWheelEvents(); ++ void taskQTBUG_51086_skippingIndexesInSelectedIndexes(); + }; + + // Testing get/set functions +@@ -2493,5 +2494,32 @@ void tst_QListView::horizontalScrollingByVerticalWheelEvents() + QVERIFY(lv.verticalScrollBar()->value() > vValue); + } + ++void tst_QListView::taskQTBUG_51086_skippingIndexesInSelectedIndexes() ++{ ++ // simple way to get access to selectedIndexes() ++ class QListViewWithPublicSelectedIndexes : public QListView ++ { ++ public: ++ using QListView::selectedIndexes; ++ }; ++ ++ QStandardItemModel data(10, 1); ++ QItemSelectionModel selections(&data); ++ QListViewWithPublicSelectedIndexes list; ++ list.setModel(&data); ++ list.setSelectionModel(&selections); ++ ++ list.setRowHidden(7, true); ++ list.setRowHidden(8, true); ++ ++ for (int i = 0, count = data.rowCount(); i < count; ++i) ++ selections.select(data.index(i, 0), QItemSelectionModel::Select); ++ ++ const QModelIndexList indexes = list.selectedIndexes(); ++ ++ QVERIFY(!indexes.contains(data.index(7, 0))); ++ QVERIFY(!indexes.contains(data.index(8, 0))); ++} ++ + QTEST_MAIN(tst_QListView) + #include "tst_qlistview.moc" +-- +2.5.0 + diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 16105bf..496f545 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -44,7 +44,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.30.%{prerelease}%{?dist} +Release: 0.31.%{prerelease}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -98,6 +98,9 @@ Patch100: qt5-qtbase-5.6.0-el6-sqrt.patch # https://codereview.qt-project.org/126102/ Patch150: moc-get-the-system-defines-from-the-compiler-itself.patch +# Item views, https://bugreports.qt.io/browse/QTBUG-48870 +Patch176: 0076-QListView-fix-skipping-indexes-in-selectedIndexes.patch + # macros, be mindful to keep sync'd with macros.qt5 Source10: macros.qt5 %define _qt5 %{name} @@ -344,6 +347,7 @@ RPM macros for building Qt5 packages. %patch100 -p1 -b .sqrt %patch150 -p1 -b .moc_system_defines +%patch176 -p1 -b .0076 ## adjust $RPM_OPT_FLAGS # remove -fexceptions @@ -930,6 +934,9 @@ fi %changelog +* Wed Feb 24 2016 Rex Dieter 5.6.0-0.31.rc +- Item views don't handle insert/remove of rows robustly (QTBUG-48870) + * Tue Feb 23 2016 Helio Chissini de Castro - 5.6.0-0.30.rc - Update to final RC From 7f9dd5fd564a1b9310684d0b9aa70ee0f0b52cb7 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Thu, 25 Feb 2016 08:57:26 -0600 Subject: [PATCH 48/62] qt5-qtbase-static missing dependencies (#1311311) --- qt5-qtbase.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 496f545..68bd48e 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -44,7 +44,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.31.%{prerelease}%{?dist} +Release: 0.32.%{prerelease}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -263,6 +263,10 @@ Summary: Static library files for %{name} Requires: %{name}-devel%{?_isa} = %{version}-%{release} Requires: pkgconfig(fontconfig) Requires: pkgconfig(glib-2.0) +%if 0%{?fedora} +Requires: pkgconfig(libinput) +Requires: pkgconfig(xkbcommon) +%endif Requires: pkgconfig(zlib) %description static %{summary}. @@ -934,6 +938,9 @@ fi %changelog +* Thu Feb 25 2016 Rex Dieter 5.6.0-0.32.rc +- qt5-qtbase-static missing dependencies (#1311311) + * Wed Feb 24 2016 Rex Dieter 5.6.0-0.31.rc - Item views don't handle insert/remove of rows robustly (QTBUG-48870) From a09edb40e5587bd34d73aaec637d89d049ebbb0e Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Thu, 25 Feb 2016 09:22:40 -0600 Subject: [PATCH 49/62] ship $$[QT_INSTALL_DATA]/qtlogging.ini for packaged logging defaults (#1227295) --- qt5-qtbase.spec | 11 ++++++++++- qtlogging.ini | 4 ++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 qtlogging.ini diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 68bd48e..ee76733 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -44,7 +44,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.32.%{prerelease}%{?dist} +Release: 0.33.%{prerelease}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -55,6 +55,9 @@ Source0: http://download.qt.io/development_releases/qt/5.6/%{version}-%{prerelea Source0: http://download.qt.io/official_releases/qt/5.6/%{version}%{?prerelease:-%{prerelease}}/submodules/%{qt_module}-opensource-src-%{version}%{?prerelease:-%{prerelease}}.tar.xz %endif +# https://bugzilla.redhat.com/show_bug.cgi?id=1227295 +Source1: qtlogging.ini + # header file to workaround multilib issue # https://bugzilla.redhat.com/show_bug.cgi?id=1036956 Source5: qconfig-multilib.h @@ -500,6 +503,8 @@ make install INSTALL_ROOT=%{buildroot} make install_docs INSTALL_ROOT=%{buildroot} %endif +install -m644 -p -D %{SOURCE1} %{buildroot}%{_qt5_datadir}/qtlogging.ini + # Qt5.pc cat >%{buildroot}%{_libdir}/pkgconfig/Qt5.pc< 5.6.0-0.33.rc +- ship $$[QT_INSTALL_DATA]/qtlogging.ini for packaged logging defaults (#1227295) + * Thu Feb 25 2016 Rex Dieter 5.6.0-0.32.rc - qt5-qtbase-static missing dependencies (#1311311) diff --git a/qtlogging.ini b/qtlogging.ini new file mode 100644 index 0000000..c5a063d --- /dev/null +++ b/qtlogging.ini @@ -0,0 +1,4 @@ +[Rules] +# distro defaults, see also https://bugzilla.redhat.com/show_bug.cgi?id=1227295 +# can override in $XDG_CONFIG_HOME/QtProject/qtlogging.ini or $XDG_CONFIG_DIR/QtProject/qtlogging.ini +*.debug=false From 06ce22ee6b0f48f5882752eef78dc8b32bc35e5f Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Fri, 26 Feb 2016 06:36:39 -0600 Subject: [PATCH 50/62] qtlogging.ini: remove comments --- qt5-qtbase.spec | 5 ++++- qtlogging.ini | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index ee76733..c7587d5 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -44,7 +44,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.33.%{prerelease}%{?dist} +Release: 0.34.%{prerelease}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -944,6 +944,9 @@ fi %changelog +* Fri Feb 26 2016 Rex Dieter 5.6.0-0.34.rc +- qtlogging.ini: remove comments + * Thu Feb 25 2016 Rex Dieter 5.6.0-0.33.rc - ship $$[QT_INSTALL_DATA]/qtlogging.ini for packaged logging defaults (#1227295) diff --git a/qtlogging.ini b/qtlogging.ini index c5a063d..be2bf22 100644 --- a/qtlogging.ini +++ b/qtlogging.ini @@ -1,4 +1,2 @@ [Rules] -# distro defaults, see also https://bugzilla.redhat.com/show_bug.cgi?id=1227295 -# can override in $XDG_CONFIG_HOME/QtProject/qtlogging.ini or $XDG_CONFIG_DIR/QtProject/qtlogging.ini *.debug=false From 4e2ea086760cbab24124a8c6ffab700921a485e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vr=C3=A1til?= Date: Tue, 1 Mar 2016 18:55:15 +0100 Subject: [PATCH 51/62] Rebu8ild against new openssl --- qt5-qtbase.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index c7587d5..040ab1d 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -44,7 +44,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.34.%{prerelease}%{?dist} +Release: 0.35.%{prerelease}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -944,6 +944,9 @@ fi %changelog +* Tue Mar 01 2016 Daniel Vrátil 5.6.0-0.35.rc +- Rebuild against new openssl + * Fri Feb 26 2016 Rex Dieter 5.6.0-0.34.rc - qtlogging.ini: remove comments From 12097a463f3d84219074ce8e738afffc25418ef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vr=C3=A1til?= Date: Tue, 1 Mar 2016 19:37:06 +0100 Subject: [PATCH 52/62] Enable bootstrap to workaround the libssl.so ABI change on rawhide --- qt5-qtbase.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 040ab1d..750d7a0 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -16,7 +16,7 @@ %global rpm_macros_dir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) ## set to 1 to enable bootstrap -#global bootstrap 1 +%global bootstrap 1 %if 0%{?fedora} > 21 # use external qt_settings pkg From 08876ea371ce004b3d2599dc7c0f3825a0834ebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vr=C3=A1til?= Date: Tue, 1 Mar 2016 22:20:07 +0100 Subject: [PATCH 53/62] Fix build with bootstrap --- qt5-qtbase.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 750d7a0..c96e0cf 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -719,9 +719,11 @@ fi %doc dist/README dist/changes-5.* %{_qt5_docdir}/*.qch %if 0%{?examples} +%if 0%{!?bootstrap} # included in -examples instead, see bug #1212750 %exclude %{_qt5_docdir}/*/examples-manifest.xml %endif +%endif %{_qt5_docdir}/qmake/ %{_qt5_docdir}/qtconcurrent/ %{_qt5_docdir}/qtcore/ @@ -847,7 +849,9 @@ fi %if 0%{?examples} %files examples +%if 0%{!?bootstrap} %{_qt5_docdir}/*/examples-manifest.xml +%endif %{_qt5_examplesdir}/ %endif From 322f2b42799eb725d24d952d5239baeebea1fd35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vr=C3=A1til?= Date: Wed, 2 Mar 2016 00:55:39 +0100 Subject: [PATCH 54/62] Rebuild without bootstrapping --- qt5-qtbase.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index c96e0cf..3544ee1 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -16,7 +16,7 @@ %global rpm_macros_dir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) ## set to 1 to enable bootstrap -%global bootstrap 1 +%global bootstrap 0 %if 0%{?fedora} > 21 # use external qt_settings pkg @@ -44,7 +44,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.35.%{prerelease}%{?dist} +Release: 0.36.%{prerelease}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -948,6 +948,9 @@ fi %changelog +* Wed Mar 02 2016 Daniel Vrátil 5.6.0-0.36.rc +- Non-bootstrapped build + * Tue Mar 01 2016 Daniel Vrátil 5.6.0-0.35.rc - Rebuild against new openssl From 0030abbcaf9470b9eeb47a42b700f567929b3ff1 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Sat, 5 Mar 2016 18:07:17 -0600 Subject: [PATCH 55/62] %build: ./configure -journal (f24+) --- qt5-qtbase.spec | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 3544ee1..f47e06b 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -28,6 +28,10 @@ %global inject_optflags 1 %endif +%if 0%{?fedora} > 23 +%global journald -journald +%endif + # define to build docs, need to undef this for bootstrapping # where qt5-qttools builds are not yet available # only primary archs (for now), allow secondary to bootstrap @@ -44,7 +48,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.36.%{prerelease}%{?dist} +Release: 0.37.%{prerelease}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -452,6 +456,7 @@ export MAKEFLAGS="%{?_smp_mflags}" %{?ibase} \ -iconv \ -icu \ + %{?journald} \ -openssl-linked \ -optimized-qmake \ %{!?examples:-nomake examples} \ @@ -948,6 +953,9 @@ fi %changelog +* Sat Mar 05 2016 Rex Dieter 5.6.0-0.37.rc +- %build: ./configure -journal (f24+) + * Wed Mar 02 2016 Daniel Vrátil 5.6.0-0.36.rc - Non-bootstrapped build From 5523e1423fa0e048497dfa7c19cb47693dc3dfa8 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Mon, 7 Mar 2016 13:20:01 -0600 Subject: [PATCH 56/62] backport "crash on start if system bus is not available" (QTBUG-51299) --- ...-when-a-standard-bus-isn-t-available.patch | 43 +++++++++++++++++++ qt5-qtbase.spec | 10 ++++- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 0002-Fix-crash-when-a-standard-bus-isn-t-available.patch diff --git a/0002-Fix-crash-when-a-standard-bus-isn-t-available.patch b/0002-Fix-crash-when-a-standard-bus-isn-t-available.patch new file mode 100644 index 0000000..5c15004 --- /dev/null +++ b/0002-Fix-crash-when-a-standard-bus-isn-t-available.patch @@ -0,0 +1,43 @@ +From 469e293286f7b9ea093fdac41938e00082c70bcd Mon Sep 17 00:00:00 2001 +From: Thiago Macieira +Date: Mon, 22 Feb 2016 14:44:30 -0800 +Subject: [PATCH 2/6] Fix crash when a standard bus isn't available + +Commit 1f6fa1f37a14742ddf53c753ce52d9dc048cd1dc added a way of +suspending delivery of messages to standard buses when they connect and +resuming delivery when the main loop starts. As a side-effect, we caused +an attempt to do dispatching even after the connection failed. The D-Bus +library doesn't like that. + +Task-number: QTBUG-51299 +Change-Id: I0c94a5c2846b48c8aea7ffff143564f7fcede890 +Reviewed-by: David Faure +--- + src/dbus/qdbusconnection.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp +index 7f44272..34b3da7 100644 +--- a/src/dbus/qdbusconnection.cpp ++++ b/src/dbus/qdbusconnection.cpp +@@ -208,7 +208,7 @@ QDBusConnectionPrivate *QDBusConnectionManager::connectToBus(QDBusConnection::Bu + data.suspendedDelivery = suspendedDelivery; + + emit connectionRequested(&data); +- if (suspendedDelivery) { ++ if (suspendedDelivery && data.result->connection) { + data.result->ref.ref(); + QDBusConnectionDispatchEnabler *o = new QDBusConnectionDispatchEnabler(data.result); + QTimer::singleShot(0, o, SLOT(execute())); +@@ -291,7 +291,7 @@ void QDBusConnectionManager::executeConnectionRequest(QDBusConnectionManager::Co + // will lock in QDBusConnectionPrivate::connectRelay() + d->setConnection(c, error); + d->createBusService(); +- if (data->suspendedDelivery) ++ if (c && data->suspendedDelivery) + d->setDispatchEnabled(false); + } + } +-- +2.5.0 + diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index f47e06b..866981f 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -48,7 +48,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.37.%{prerelease}%{?dist} +Release: 0.38.%{prerelease}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -101,6 +101,9 @@ Patch100: qt5-qtbase-5.6.0-el6-sqrt.patch ## upstream patches +Patch102: 0002-Fix-crash-when-a-standard-bus-isn-t-available.patch + + # recently passed code review, not integrated yet # https://codereview.qt-project.org/126102/ Patch150: moc-get-the-system-defines-from-the-compiler-itself.patch @@ -357,6 +360,8 @@ RPM macros for building Qt5 packages. %patch100 -p1 -b .sqrt +%patch102 -p1 -b .QTBUG-51299 + %patch150 -p1 -b .moc_system_defines %patch176 -p1 -b .0076 @@ -953,6 +958,9 @@ fi %changelog +* Mon Mar 07 2016 Rex Dieter 5.6.0-0.38.rc +- backport "crash on start if system bus is not available" (QTBUG-51299) + * Sat Mar 05 2016 Rex Dieter 5.6.0-0.37.rc - %build: ./configure -journal (f24+) From f06686fa093c4a2d7d6ffa8d219cc8cc265868bc Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Thu, 10 Mar 2016 10:44:24 -0600 Subject: [PATCH 57/62] candidate fixes for various QtDBus deadlocks (QTBUG-51648,QTBUG-51649,QTBUG-51676) --- ...signal-hooks-and-object-tree-in-clos.patch | 88 +++++++++++ ...l-pending-call-with-error-if-disconn.patch | 142 ++++++++++++++++++ ...nchrnoize-local-message-in-daemon-th.patch | 37 +++++ qt5-qtbase.spec | 18 ++- 4 files changed, 284 insertions(+), 1 deletion(-) create mode 100644 QTBUG-51648-QtDBus-clean-up-signal-hooks-and-object-tree-in-clos.patch create mode 100644 QTBUG-51649-QtDBus-finish-all-pending-call-with-error-if-disconn.patch create mode 100644 QTBUG-51676-QtDBus-do-not-synchrnoize-local-message-in-daemon-th.patch diff --git a/QTBUG-51648-QtDBus-clean-up-signal-hooks-and-object-tree-in-clos.patch b/QTBUG-51648-QtDBus-clean-up-signal-hooks-and-object-tree-in-clos.patch new file mode 100644 index 0000000..26c15d0 --- /dev/null +++ b/QTBUG-51648-QtDBus-clean-up-signal-hooks-and-object-tree-in-clos.patch @@ -0,0 +1,88 @@ +From b024fbe83863fc57364a52c717d5b43d654bdb5d Mon Sep 17 00:00:00 2001 +From: Weng Xuetian +Date: Sat, 5 Mar 2016 12:23:21 -0800 +Subject: [PATCH] QtDBus: clean up signal hooks and object tree in + closeConnection + +If a QObject is added or passed as receiver to QDBusConnection::connect() +and it is managed by Q_GLOBAL_STATIC or similar mechanism, it is +possible that when that its destructor is called after the dbus daemon +thread ends. In that case, QObject::destroyed connected via +Qt::BlockingQueuedConnection to QDBusConnectionPrivate will cause dead +lock since the thread is no longer processing events. + +Task-number: QTBUG-51648 +Change-Id: I1a1810a6d6d0234af0269d5f3fc1f54101bf1547 +--- + src/dbus/qdbusconnection_p.h | 1 + + src/dbus/qdbusintegrator.cpp | 28 +++++++++++++++++++++++++++- + 2 files changed, 28 insertions(+), 1 deletion(-) + +diff --git a/src/dbus/qdbusconnection_p.h b/src/dbus/qdbusconnection_p.h +index c77daf7..565eb83 100644 +--- a/src/dbus/qdbusconnection_p.h ++++ b/src/dbus/qdbusconnection_p.h +@@ -254,6 +254,7 @@ private: + const QVector &metaTypes, int slotIdx); + + SignalHookHash::Iterator removeSignalHookNoLock(SignalHookHash::Iterator it); ++ void disconnectObjectTree(ObjectTreeNode &node); + + bool isServiceRegisteredByThread(const QString &serviceName); + +diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp +index cd44861..a3cd47b 100644 +--- a/src/dbus/qdbusintegrator.cpp ++++ b/src/dbus/qdbusintegrator.cpp +@@ -1030,7 +1030,6 @@ QDBusConnectionPrivate::~QDBusConnectionPrivate() + qPrintable(name)); + + closeConnection(); +- rootNode.children.clear(); // free resources + qDeleteAll(cachedMetaObjects); + + if (mode == ClientMode || mode == PeerMode) { +@@ -1052,6 +1051,20 @@ QDBusConnectionPrivate::~QDBusConnectionPrivate() + } + } + ++void QDBusConnectionPrivate::disconnectObjectTree(QDBusConnectionPrivate::ObjectTreeNode &haystack) ++{ ++ QDBusConnectionPrivate::ObjectTreeNode::DataList::Iterator it = haystack.children.begin(); ++ ++ while (it != haystack.children.end()) { ++ disconnectObjectTree(*it); ++ it++; ++ } ++ ++ if (haystack.obj) { ++ haystack.obj->disconnect(this); ++ } ++} ++ + void QDBusConnectionPrivate::closeConnection() + { + QDBusWriteLocker locker(CloseConnectionAction, this); +@@ -1075,6 +1088,19 @@ void QDBusConnectionPrivate::closeConnection() + } + + qDeleteAll(pendingCalls); ++ ++ // clean up all signal hook and object tree, to avoid QObject::destroyed ++ // being activated to dbus daemon thread which already quits. ++ // dbus connection is already closed, so there is nothing we could do be clean ++ // up everything here. ++ SignalHookHash::iterator sit = signalHooks.begin(); ++ while (sit != signalHooks.end()) { ++ sit.value().obj->disconnect(this); ++ sit++; ++ } ++ ++ disconnectObjectTree(rootNode); ++ rootNode.children.clear(); // free resources + } + + void QDBusConnectionPrivate::checkThread() +-- +2.5.0 + diff --git a/QTBUG-51649-QtDBus-finish-all-pending-call-with-error-if-disconn.patch b/QTBUG-51649-QtDBus-finish-all-pending-call-with-error-if-disconn.patch new file mode 100644 index 0000000..a3794b8 --- /dev/null +++ b/QTBUG-51649-QtDBus-finish-all-pending-call-with-error-if-disconn.patch @@ -0,0 +1,142 @@ +From 136eeec876ed5b995e7c27bcdcefe0199f5f183d Mon Sep 17 00:00:00 2001 +From: Weng Xuetian +Date: Thu, 3 Mar 2016 21:56:53 -0800 +Subject: [PATCH] QtDBus: finish all pending call with error if disconnected + +libdbus will send a local signal if connection gets disconnected. When +this happens, end all pending calls with QDBusError::Disconnected. + +Task-number: QTBUG-51649 +Change-Id: I5c7d2a468bb5da746d0c0e53e458c1e376f186a9 +--- + src/dbus/qdbusintegrator.cpp | 26 +++++++++++++++++----- + src/dbus/qdbusutil_p.h | 6 +++++ + .../dbus/qdbusconnection/tst_qdbusconnection.cpp | 22 ++++++++++++++++++ + .../dbus/qdbusconnection/tst_qdbusconnection.h | 1 + + 4 files changed, 49 insertions(+), 6 deletions(-) + +diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp +index cd44861..320419f 100644 +--- a/src/dbus/qdbusintegrator.cpp ++++ b/src/dbus/qdbusintegrator.cpp +@@ -519,6 +519,14 @@ bool QDBusConnectionPrivate::handleMessage(const QDBusMessage &amsg) + switch (amsg.type()) { + case QDBusMessage::SignalMessage: + handleSignal(amsg); ++ // Check local disconnected signal from libdbus ++ if (amsg.interface() == QDBusUtil::dbusInterfaceLocal() ++ && amsg.path() == QDBusUtil::dbusPathLocal() ++ && amsg.member() == QDBusUtil::disconnected() ++ && !QDBusMessagePrivate::isLocal(amsg)) { ++ while (!pendingCalls.isEmpty()) ++ processFinishedCall(pendingCalls.first()); ++ } + // if there are any other filters in this DBusConnection, + // let them see the signal too + return false; +@@ -1767,10 +1775,16 @@ void QDBusConnectionPrivate::processFinishedCall(QDBusPendingCallPrivate *call) + + QDBusMessage &msg = call->replyMessage; + if (call->pending) { +- // decode the message +- DBusMessage *reply = q_dbus_pending_call_steal_reply(call->pending); +- msg = QDBusMessagePrivate::fromDBusMessage(reply, connection->capabilities); +- q_dbus_message_unref(reply); ++ // when processFinishedCall is called and pending call is not completed, ++ // it means we received disconnected signal from libdbus ++ if (q_dbus_pending_call_get_completed(call->pending)) { ++ // decode the message ++ DBusMessage *reply = q_dbus_pending_call_steal_reply(call->pending); ++ msg = QDBusMessagePrivate::fromDBusMessage(reply, connection->capabilities); ++ q_dbus_message_unref(reply); ++ } else { ++ msg = QDBusMessage::createError(QDBusError::Disconnected, QDBusUtil::disconnectedErrorMessage()); ++ } + } + qDBusDebug() << connection << "got message reply:" << msg; + +@@ -2070,8 +2084,8 @@ void QDBusConnectionPrivate::sendInternal(QDBusPendingCallPrivate *pcall, void * + pcall->pending = pending; + q_dbus_pending_call_set_notify(pending, qDBusResultReceived, pcall, 0); + +- // DBus won't notify us when a peer disconnects so we need to track these ourselves +- if (mode == QDBusConnectionPrivate::PeerMode) ++ // DBus won't notify us when a peer disconnects or server terminates so we need to track these ourselves ++ if (mode == QDBusConnectionPrivate::PeerMode || mode == QDBusConnectionPrivate::ClientMode) + pendingCalls.append(pcall); + + return; +diff --git a/src/dbus/qdbusutil_p.h b/src/dbus/qdbusutil_p.h +index 8f5ae92..ca70ff9 100644 +--- a/src/dbus/qdbusutil_p.h ++++ b/src/dbus/qdbusutil_p.h +@@ -155,6 +155,8 @@ namespace QDBusUtil + { return QStringLiteral(DBUS_SERVICE_DBUS); } + inline QString dbusPath() + { return QStringLiteral(DBUS_PATH_DBUS); } ++ inline QString dbusPathLocal() ++ { return QStringLiteral(DBUS_PATH_LOCAL); } + inline QString dbusInterface() + { + // it's the same string, but just be sure +@@ -165,8 +167,12 @@ namespace QDBusUtil + { return QStringLiteral(DBUS_INTERFACE_PROPERTIES); } + inline QString dbusInterfaceIntrospectable() + { return QStringLiteral(DBUS_INTERFACE_INTROSPECTABLE); } ++ inline QString dbusInterfaceLocal() ++ { return QStringLiteral(DBUS_INTERFACE_LOCAL); } + inline QString nameOwnerChanged() + { return QStringLiteral("NameOwnerChanged"); } ++ inline QString disconnected() ++ { return QStringLiteral("Disconnected"); } + inline QString disconnectedErrorMessage() + { return QStringLiteral("Not connected to D-Bus server"); } + } +diff --git a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp +index e91f87d..6c7e6b1 100644 +--- a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp ++++ b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp +@@ -1218,6 +1218,28 @@ void tst_QDBusConnection::callVirtualObjectLocal() + QCOMPARE(obj.replyArguments, subPathReply.arguments()); + } + ++void tst_QDBusConnection::pendingCallWhenDisconnected() ++{ ++ QDBusServer *server = new QDBusServer; ++ QDBusConnection con = QDBusConnection::connectToPeer(server->address(), "disconnect"); ++ QTestEventLoop::instance().enterLoop(2); ++ QVERIFY(!QTestEventLoop::instance().timeout()); ++ QVERIFY(con.isConnected()); ++ ++ delete server; ++ ++ // Make sure we call the method before we know it is disconnected. ++ QVERIFY(con.isConnected()); ++ QDBusMessage message = QDBusMessage::createMethodCall("", "/", QString(), "method"); ++ QDBusPendingCall reply = con.asyncCall(message); ++ ++ QTestEventLoop::instance().enterLoop(2); ++ QVERIFY(!con.isConnected()); ++ QVERIFY(reply.isFinished()); ++ QVERIFY(reply.isError()); ++ QVERIFY(reply.error().type() == QDBusError::Disconnected); ++} ++ + QString MyObject::path; + QString MyObjectWithoutInterface::path; + QString MyObjectWithoutInterface::interface; +diff --git a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h +index a53ba32..720e484 100644 +--- a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h ++++ b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h +@@ -121,6 +121,7 @@ private slots: + void registerVirtualObject(); + void callVirtualObject(); + void callVirtualObjectLocal(); ++ void pendingCallWhenDisconnected(); + + public: + QString serviceName() const { return "org.qtproject.Qt.Autotests.QDBusConnection"; } +-- +2.5.0 + diff --git a/QTBUG-51676-QtDBus-do-not-synchrnoize-local-message-in-daemon-th.patch b/QTBUG-51676-QtDBus-do-not-synchrnoize-local-message-in-daemon-th.patch new file mode 100644 index 0000000..28bef18 --- /dev/null +++ b/QTBUG-51676-QtDBus-do-not-synchrnoize-local-message-in-daemon-th.patch @@ -0,0 +1,37 @@ +From d011c92b47f95554fe639ad9c0542768d802666b Mon Sep 17 00:00:00 2001 +From: Weng Xuetian +Date: Fri, 4 Mar 2016 10:53:46 -0800 +Subject: [PATCH] QtDBus: do not synchrnoize local message in daemon thread + +When qDBusAddSpyHook is used and there is a local message, the +handleObjectCall on this message will be deferred to daemon thread. It +would cause dead lock if dbus daemon thread wait for this message and +there is no point to wait for the reply since daemon thread is not same +as the message sender thread. + +Task-number: QTBUG-51676 +Change-Id: I1dc112894cde7121e8ce302ae51b438ade1ff612 +--- + src/dbus/qdbusintegrator.cpp | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp +index cd44861..caf2e92 100644 +--- a/src/dbus/qdbusintegrator.cpp ++++ b/src/dbus/qdbusintegrator.cpp +@@ -1484,8 +1484,10 @@ void QDBusConnectionPrivate::handleObjectCall(const QDBusMessage &msg) + return; + } + +- if (!QDBusMessagePrivate::isLocal(msg)) { +- // external incoming message ++ if (!QDBusMessagePrivate::isLocal(msg) || QThread::currentThread() == QDBusConnectionManager::instance()) { ++ // two cases: ++ // 1. external incoming message ++ // 2. local message deferred by spy hook + // post it and forget + postEventToThread(HandleObjectCallPostEventAction, result.obj, + new QDBusActivateObjectEvent(QDBusConnection(this), this, result, +-- +2.5.0 + diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 866981f..be3f731 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -48,7 +48,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.38.%{prerelease}%{?dist} +Release: 0.39.%{prerelease}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -96,6 +96,16 @@ Patch53: qtbase-opensource-src-5.6.0-alsa-1.1.patch # arm patch Patch54: qtbase-opensource-src-5.6.0-arm.patch +# https://codereview.qt-project.org/#/c/151496/ +Patch55: QTBUG-51648-QtDBus-clean-up-signal-hooks-and-object-tree-in-clos.patch + +# https://codereview.qt-project.org/#/c/151340/ +Patch56: QTBUG-51649-QtDBus-finish-all-pending-call-with-error-if-disconn.patch + +# https://codereview.qt-project.org/#/c/151459/ +Patch57: QTBUG-51676-QtDBus-do-not-synchrnoize-local-message-in-daemon-th.patch + + # Epel patches Patch100: qt5-qtbase-5.6.0-el6-sqrt.patch @@ -357,6 +367,9 @@ RPM macros for building Qt5 packages. %patch52 -p1 -b .moc_WORDSIZE %patch53 -p1 -b .alsa1.1 %patch54 -p1 -b .arm +%patch55 -p1 -b .QTBUG-51648 +%patch56 -p1 -b .QTBUG-51649 +%patch57 -p1 -b .QTBUG-51676 %patch100 -p1 -b .sqrt @@ -958,6 +971,9 @@ fi %changelog +* Thu Mar 10 2016 Rex Dieter 5.6.0-0.39.rc +- candidate fixes for various QtDBus deadlocks (QTBUG-51648,QTBUG-51649,QTBUG-51676) + * Mon Mar 07 2016 Rex Dieter 5.6.0-0.38.rc - backport "crash on start if system bus is not available" (QTBUG-51299) From a35b80142fdebcf996c5f9b8a10731f3b39df3d2 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Thu, 10 Mar 2016 11:30:21 -0600 Subject: [PATCH 58/62] omit FTBFS QTBUG-51649 patch --- qt5-qtbase.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index be3f731..7a1b4bb 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -368,7 +368,8 @@ RPM macros for building Qt5 packages. %patch53 -p1 -b .alsa1.1 %patch54 -p1 -b .arm %patch55 -p1 -b .QTBUG-51648 -%patch56 -p1 -b .QTBUG-51649 +## FTBFS, omit for now +#patch56 -p1 -b .QTBUG-51649 %patch57 -p1 -b .QTBUG-51676 %patch100 -p1 -b .sqrt @@ -972,7 +973,7 @@ fi %changelog * Thu Mar 10 2016 Rex Dieter 5.6.0-0.39.rc -- candidate fixes for various QtDBus deadlocks (QTBUG-51648,QTBUG-51649,QTBUG-51676) +- candidate fixes for various QtDBus deadlocks (QTBUG-51648,QTBUG-51676) * Mon Mar 07 2016 Rex Dieter 5.6.0-0.38.rc - backport "crash on start if system bus is not available" (QTBUG-51299) From 90b700be51d1c289ed990b4ab26b0810849a5d77 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Fri, 11 Mar 2016 11:48:46 -0600 Subject: [PATCH 59/62] 5.6.0-0.40.rc - respin QTBUG-51649 patch - %build: use -dbus-runtime unconditionally - drop (unused) build deps: atspi, dbus, networkmanager --- ...ll-pending-call-with-error-if-disconn.patch | 14 ++++++++++++++ qt5-qtbase.spec | 18 ++++++++---------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/QTBUG-51649-QtDBus-finish-all-pending-call-with-error-if-disconn.patch b/QTBUG-51649-QtDBus-finish-all-pending-call-with-error-if-disconn.patch index a3794b8..bf13f57 100644 --- a/QTBUG-51649-QtDBus-finish-all-pending-call-with-error-if-disconn.patch +++ b/QTBUG-51649-QtDBus-finish-all-pending-call-with-error-if-disconn.patch @@ -140,3 +140,17 @@ index a53ba32..720e484 100644 -- 2.5.0 +diff -up qtbase-opensource-src-5.6.0-rc/src/dbus/dbus_minimal_p.h.QTBUG-51649 qtbase-opensource-src-5.6.0-rc/src/dbus/dbus_minimal_p.h +--- qtbase-opensource-src-5.6.0-rc/src/dbus/dbus_minimal_p.h.QTBUG-51649 2016-02-18 01:24:38.000000000 -0600 ++++ qtbase-opensource-src-5.6.0-rc/src/dbus/dbus_minimal_p.h 2016-03-11 11:40:11.176244645 -0600 +@@ -99,8 +99,10 @@ typedef dbus_uint32_t dbus_bool_t; + /* dbus-shared.h */ + #define DBUS_SERVICE_DBUS "org.freedesktop.DBus" + #define DBUS_PATH_DBUS "/org/freedesktop/DBus" ++#define DBUS_PATH_LOCAL "/org/freedesktop/DBus/Local" + #define DBUS_INTERFACE_DBUS "org.freedesktop.DBus" + #define DBUS_INTERFACE_INTROSPECTABLE "org.freedesktop.DBus.Introspectable" ++#define DBUS_INTERFACE_LOCAL "org.freedesktop.DBus.Local" + #define DBUS_INTERFACE_PROPERTIES "org.freedesktop.DBus.Properties" + + #define DBUS_NAME_FLAG_ALLOW_REPLACEMENT 0x1 /**< Allow another service to become the primary owner if requested */ diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 7a1b4bb..a71ea9c 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -48,7 +48,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.39.%{prerelease}%{?dist} +Release: 0.40.%{prerelease}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -158,11 +158,6 @@ BuildRequires: libjpeg-devel BuildRequires: libmng-devel BuildRequires: libtiff-devel BuildRequires: pkgconfig(alsa) -# http://bugzilla.redhat.com/1196359 -%if 0%{?fedora} || 0%{?rhel} > 6 -%global dbus -dbus-linked -BuildRequires: pkgconfig(dbus-1) -%endif BuildRequires: pkgconfig(libdrm) BuildRequires: pkgconfig(fontconfig) BuildRequires: pkgconfig(gl) @@ -173,7 +168,6 @@ BuildRequires: pkgconfig(libproxy-1.0) BuildRequires: pkgconfig(ice) pkgconfig(sm) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(libudev) -BuildRequires: pkgconfig(NetworkManager) BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(libpulse) pkgconfig(libpulse-mainloop-glib) %if 0%{?fedora} @@ -193,7 +187,6 @@ Provides: bundled(libxkbcommon) = 0.4.1 BuildRequires: pkgconfig(xkeyboard-config) %if 0%{?fedora} || 0%{?rhel} > 6 %define egl 1 -BuildRequires: pkgconfig(atspi-2) BuildRequires: pkgconfig(egl) BuildRequires: pkgconfig(gbm) BuildRequires: pkgconfig(glesv2) @@ -369,7 +362,7 @@ RPM macros for building Qt5 packages. %patch54 -p1 -b .arm %patch55 -p1 -b .QTBUG-51648 ## FTBFS, omit for now -#patch56 -p1 -b .QTBUG-51649 +%patch56 -p1 -b .QTBUG-51649 %patch57 -p1 -b .QTBUG-51676 %patch100 -p1 -b .sqrt @@ -468,7 +461,7 @@ export MAKEFLAGS="%{?_smp_mflags}" -release \ -shared \ -accessibility \ - %{?dbus}%{!?dbus:-dbus} \ + -dbus-runtime \ -fontconfig \ -glib \ -gtkstyle \ @@ -972,6 +965,11 @@ fi %changelog +* Fri Mar 11 2016 Rex Dieter 5.6.0-0.40.rc +- respin QTBUG-51649 patch +- %%build: use -dbus-runtime unconditionally +- drop (unused) build deps: atspi, dbus, networkmanager + * Thu Mar 10 2016 Rex Dieter 5.6.0-0.39.rc - candidate fixes for various QtDBus deadlocks (QTBUG-51648,QTBUG-51676) From 1686a4e3100f34c04ac9430c4fdd80bc5eac0449 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Sat, 12 Mar 2016 10:47:41 -0600 Subject: [PATCH 60/62] %build: restore -dbus-linked --- qt5-qtbase.spec | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index a71ea9c..2ec5d4e 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -48,7 +48,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.40.%{prerelease}%{?dist} +Release: 0.41.%{prerelease}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -158,6 +158,11 @@ BuildRequires: libjpeg-devel BuildRequires: libmng-devel BuildRequires: libtiff-devel BuildRequires: pkgconfig(alsa) +# http://bugzilla.redhat.com/1196359 +%if 0%{?fedora} || 0%{?rhel} > 6 +%global dbus -dbus-linked +BuildRequires: pkgconfig(dbus-1) +%endif BuildRequires: pkgconfig(libdrm) BuildRequires: pkgconfig(fontconfig) BuildRequires: pkgconfig(gl) @@ -461,7 +466,7 @@ export MAKEFLAGS="%{?_smp_mflags}" -release \ -shared \ -accessibility \ - -dbus-runtime \ + %{?dbus}%{!?dbus:-dbus-runtime} \ -fontconfig \ -glib \ -gtkstyle \ @@ -965,6 +970,9 @@ fi %changelog +* Sat Mar 12 2016 Rex Dieter 5.6.0-0.41.rc +- %%build: restore -dbus-linked + * Fri Mar 11 2016 Rex Dieter 5.6.0-0.40.rc - respin QTBUG-51649 patch - %%build: use -dbus-runtime unconditionally From cf904fea3a2dcbbea2c4d922c846bba2633dcdab Mon Sep 17 00:00:00 2001 From: Helio Chissini de Castro Date: Mon, 14 Mar 2016 15:08:14 +0100 Subject: [PATCH 61/62] - 5.6.0 release --- .gitignore | 1 + ...-when-a-standard-bus-isn-t-available.patch | 43 ------------------- qt5-qtbase.spec | 19 +++----- sources | 2 +- 4 files changed, 8 insertions(+), 57 deletions(-) delete mode 100644 0002-Fix-crash-when-a-standard-bus-isn-t-available.patch diff --git a/.gitignore b/.gitignore index db121f6..b0f84a5 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /qtbase-opensource-src-5.6.0-beta.tar.gz /qtbase-opensource-src-5.6.0-rc.tar.xz /sources +/qtbase-opensource-src-5.6.0.tar.xz diff --git a/0002-Fix-crash-when-a-standard-bus-isn-t-available.patch b/0002-Fix-crash-when-a-standard-bus-isn-t-available.patch deleted file mode 100644 index 5c15004..0000000 --- a/0002-Fix-crash-when-a-standard-bus-isn-t-available.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 469e293286f7b9ea093fdac41938e00082c70bcd Mon Sep 17 00:00:00 2001 -From: Thiago Macieira -Date: Mon, 22 Feb 2016 14:44:30 -0800 -Subject: [PATCH 2/6] Fix crash when a standard bus isn't available - -Commit 1f6fa1f37a14742ddf53c753ce52d9dc048cd1dc added a way of -suspending delivery of messages to standard buses when they connect and -resuming delivery when the main loop starts. As a side-effect, we caused -an attempt to do dispatching even after the connection failed. The D-Bus -library doesn't like that. - -Task-number: QTBUG-51299 -Change-Id: I0c94a5c2846b48c8aea7ffff143564f7fcede890 -Reviewed-by: David Faure ---- - src/dbus/qdbusconnection.cpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp -index 7f44272..34b3da7 100644 ---- a/src/dbus/qdbusconnection.cpp -+++ b/src/dbus/qdbusconnection.cpp -@@ -208,7 +208,7 @@ QDBusConnectionPrivate *QDBusConnectionManager::connectToBus(QDBusConnection::Bu - data.suspendedDelivery = suspendedDelivery; - - emit connectionRequested(&data); -- if (suspendedDelivery) { -+ if (suspendedDelivery && data.result->connection) { - data.result->ref.ref(); - QDBusConnectionDispatchEnabler *o = new QDBusConnectionDispatchEnabler(data.result); - QTimer::singleShot(0, o, SLOT(execute())); -@@ -291,7 +291,7 @@ void QDBusConnectionManager::executeConnectionRequest(QDBusConnectionManager::Co - // will lock in QDBusConnectionPrivate::connectRelay() - d->setConnection(c, error); - d->createBusService(); -- if (data->suspendedDelivery) -+ if (c && data->suspendedDelivery) - d->setDispatchEnabled(false); - } - } --- -2.5.0 - diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 2ec5d4e..903eba2 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -43,21 +43,17 @@ %define examples 1 -%define prerelease rc +#define prerelease rc Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 0.41.%{prerelease}%{?dist} +Release: 1%{?prerelease:.${prerelease}}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions Url: http://qt-project.org/ -%if 0%{?prerelease:1} -Source0: http://download.qt.io/development_releases/qt/5.6/%{version}-%{prerelease}/submodules/%{qt_module}-opensource-src-%{version}-%{prerelease}.tar.xz -%else Source0: http://download.qt.io/official_releases/qt/5.6/%{version}%{?prerelease:-%{prerelease}}/submodules/%{qt_module}-opensource-src-%{version}%{?prerelease:-%{prerelease}}.tar.xz -%endif # https://bugzilla.redhat.com/show_bug.cgi?id=1227295 Source1: qtlogging.ini @@ -109,10 +105,6 @@ Patch57: QTBUG-51676-QtDBus-do-not-synchrnoize-local-message-in-daemon-th.patch # Epel patches Patch100: qt5-qtbase-5.6.0-el6-sqrt.patch -## upstream patches - -Patch102: 0002-Fix-crash-when-a-standard-bus-isn-t-available.patch - # recently passed code review, not integrated yet # https://codereview.qt-project.org/126102/ @@ -372,8 +364,6 @@ RPM macros for building Qt5 packages. %patch100 -p1 -b .sqrt -%patch102 -p1 -b .QTBUG-51299 - %patch150 -p1 -b .moc_system_defines %patch176 -p1 -b .0076 @@ -406,7 +396,7 @@ sed -i -e "s|^\(QMAKE_LFLAGS_RELEASE.*\)|\1 $RPM_LD_FLAGS|" \ sed -i -e 's|^\(QMAKE_STRIP.*=\).*$|\1|g' mkspecs/common/linux.conf %endif -%if %{prerelease} +%if 0%{?prerelease} bin/syncqt.pl -version %{version} %endif @@ -970,6 +960,9 @@ fi %changelog +* Mon Mar 14 2016 Helio Chissini de Castro - 5.6.0-1 +- 5.6.0 release + * Sat Mar 12 2016 Rex Dieter 5.6.0-0.41.rc - %%build: restore -dbus-linked diff --git a/sources b/sources index cbd1b52..d796aec 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -82e5bd59946630ec36ab357f1779f411 qtbase-opensource-src-5.6.0-rc.tar.xz +833a991814a38947aa07da7dfd4eb153 qtbase-opensource-src-5.6.0.tar.xz From c722cef9155548172f231a7f5029519d60955fad Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Tue, 15 Mar 2016 13:12:07 -0500 Subject: [PATCH 62/62] respin QTBUG-51767 patch --- ...Fix-QtDBus-deadlock-inside-kded-kiod.patch | 81 +++++++++++++++++++ ...nchrnoize-local-message-in-daemon-th.patch | 37 --------- qt5-qtbase.spec | 8 +- 3 files changed, 86 insertions(+), 40 deletions(-) create mode 100644 QTBUG-51676-Fix-QtDBus-deadlock-inside-kded-kiod.patch delete mode 100644 QTBUG-51676-QtDBus-do-not-synchrnoize-local-message-in-daemon-th.patch diff --git a/QTBUG-51676-Fix-QtDBus-deadlock-inside-kded-kiod.patch b/QTBUG-51676-Fix-QtDBus-deadlock-inside-kded-kiod.patch new file mode 100644 index 0000000..d78978a --- /dev/null +++ b/QTBUG-51676-Fix-QtDBus-deadlock-inside-kded-kiod.patch @@ -0,0 +1,81 @@ +From 42e14c187f7b2eedb5be7b7a49efb4031f12a02e Mon Sep 17 00:00:00 2001 +From: Thiago Macieira +Date: Tue, 15 Mar 2016 11:00:20 -0700 +Subject: [PATCH] Fix QtDBus deadlock inside kded/kiod + +Whenever a message spy was installed, we failed to actually process +looped-back messages by queueing them for processing by the spy. That +had as a consequence that the caller got an error reply and the message, +later, we attempted to deliver the message. Since that message still was +isLocal==true, bad things happened inside the manager thread. + +The correct solution is not to queue the message for the filter. We could +have filtered the message directly, but instead this commit opts not to +filter looped-back messages. That implies kded/kiod must not attempt to +load its modules by way of a looped-back message. + +Task-number: QTBUG-51676 +Change-Id: I1dc112894cde7121e8ce302ae51b438ade1ff612 +--- + src/dbus/qdbusintegrator.cpp | 19 +++++++++++++------ + 1 file changed, 13 insertions(+), 6 deletions(-) + +diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp +index cd44861..6052766 100644 +--- a/src/dbus/qdbusintegrator.cpp ++++ b/src/dbus/qdbusintegrator.cpp +@@ -509,7 +509,12 @@ bool QDBusConnectionPrivate::handleMessage(const QDBusMessage &amsg) + { + if (!ref.load()) + return false; +- if (!dispatchEnabled && !QDBusMessagePrivate::isLocal(amsg)) { ++ ++ // local message are always delivered, regardless of filtering ++ // or whether the dispatcher is enabled ++ bool isLocal = QDBusMessagePrivate::isLocal(amsg); ++ ++ if (!dispatchEnabled && !isLocal) { + // queue messages only, we'll handle them later + qDBusDebug() << this << "delivery is suspended"; + pendingMessages << amsg; +@@ -524,7 +529,7 @@ bool QDBusConnectionPrivate::handleMessage(const QDBusMessage &amsg) + return false; + case QDBusMessage::MethodCallMessage: + // run it through the spy filters (if any) before the regular processing +- if (Q_UNLIKELY(qDBusSpyHookList.exists()) && qApp) { ++ if (Q_UNLIKELY(qDBusSpyHookList.exists()) && !isLocal && qApp) { + const QDBusSpyHookList &list = *qDBusSpyHookList; + qDBusDebug() << this << "invoking message spies"; + QCoreApplication::postEvent(qApp, new QDBusSpyCallEvent(this, QDBusConnection(this), +@@ -1451,9 +1456,9 @@ void QDBusConnectionPrivate::handleObjectCall(const QDBusMessage &msg) + // that means the dispatchLock mutex is locked + // must not call out to user code in that case + // +- // however, if the message is internal, handleMessage was called +- // directly and no lock is in place. We can therefore call out to +- // user code, if necessary ++ // however, if the message is internal, handleMessage was called directly ++ // (user's thread) and no lock is in place. We can therefore call out to ++ // user code, if necessary. + ObjectTreeNode result; + int usedLength; + QThread *objThread = 0; +@@ -1492,12 +1497,14 @@ void QDBusConnectionPrivate::handleObjectCall(const QDBusMessage &msg) + usedLength, msg)); + return; + } else if (objThread != QThread::currentThread()) { +- // synchronize with other thread ++ // looped-back message, targeting another thread: ++ // synchronize with it + postEventToThread(HandleObjectCallPostEventAction, result.obj, + new QDBusActivateObjectEvent(QDBusConnection(this), this, result, + usedLength, msg, &sem)); + semWait = true; + } else { ++ // looped-back message, targeting current thread + semWait = false; + } + } // release the lock +-- +2.5.0 + diff --git a/QTBUG-51676-QtDBus-do-not-synchrnoize-local-message-in-daemon-th.patch b/QTBUG-51676-QtDBus-do-not-synchrnoize-local-message-in-daemon-th.patch deleted file mode 100644 index 28bef18..0000000 --- a/QTBUG-51676-QtDBus-do-not-synchrnoize-local-message-in-daemon-th.patch +++ /dev/null @@ -1,37 +0,0 @@ -From d011c92b47f95554fe639ad9c0542768d802666b Mon Sep 17 00:00:00 2001 -From: Weng Xuetian -Date: Fri, 4 Mar 2016 10:53:46 -0800 -Subject: [PATCH] QtDBus: do not synchrnoize local message in daemon thread - -When qDBusAddSpyHook is used and there is a local message, the -handleObjectCall on this message will be deferred to daemon thread. It -would cause dead lock if dbus daemon thread wait for this message and -there is no point to wait for the reply since daemon thread is not same -as the message sender thread. - -Task-number: QTBUG-51676 -Change-Id: I1dc112894cde7121e8ce302ae51b438ade1ff612 ---- - src/dbus/qdbusintegrator.cpp | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp -index cd44861..caf2e92 100644 ---- a/src/dbus/qdbusintegrator.cpp -+++ b/src/dbus/qdbusintegrator.cpp -@@ -1484,8 +1484,10 @@ void QDBusConnectionPrivate::handleObjectCall(const QDBusMessage &msg) - return; - } - -- if (!QDBusMessagePrivate::isLocal(msg)) { -- // external incoming message -+ if (!QDBusMessagePrivate::isLocal(msg) || QThread::currentThread() == QDBusConnectionManager::instance()) { -+ // two cases: -+ // 1. external incoming message -+ // 2. local message deferred by spy hook - // post it and forget - postEventToThread(HandleObjectCallPostEventAction, result.obj, - new QDBusActivateObjectEvent(QDBusConnection(this), this, result, --- -2.5.0 - diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 903eba2..ee97113 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -48,7 +48,7 @@ Summary: Qt5 - QtBase components Name: qt5-qtbase Version: 5.6.0 -Release: 1%{?prerelease:.${prerelease}}%{?dist} +Release: 2%{?prerelease:.%{prerelease}}%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -99,8 +99,7 @@ Patch55: QTBUG-51648-QtDBus-clean-up-signal-hooks-and-object-tree-in-clos.patch Patch56: QTBUG-51649-QtDBus-finish-all-pending-call-with-error-if-disconn.patch # https://codereview.qt-project.org/#/c/151459/ -Patch57: QTBUG-51676-QtDBus-do-not-synchrnoize-local-message-in-daemon-th.patch - +Patch57: QTBUG-51676-Fix-QtDBus-deadlock-inside-kded-kiod.patch # Epel patches Patch100: qt5-qtbase-5.6.0-el6-sqrt.patch @@ -960,6 +959,9 @@ fi %changelog +* Tue Mar 15 2016 Rex Dieter 5.6.0-2 +- respin QTBUG-51767 patch + * Mon Mar 14 2016 Helio Chissini de Castro - 5.6.0-1 - 5.6.0 release