diff options
author | Eric Hameleers <alien@slackware.com> | 2018-06-13 14:50:49 +0200 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2018-06-13 14:50:49 +0200 |
commit | c779e019ac53019baa07eb843aba59bc55ffec20 (patch) | |
tree | f4dd959f71cea6ac6a8741a1a8f9933a389f5bc7 /deps/qt5/patches | |
parent | e0d005c66dbed44be15070995d9d9e9200c989fa (diff) | |
download | ktown-c779e019ac53019baa07eb843aba59bc55ffec20.tar.gz ktown-c779e019ac53019baa07eb843aba59bc55ffec20.tar.xz |
Updated 'testing' in preparation for June '18 release of Plasma 5.13
Diffstat (limited to 'deps/qt5/patches')
-rw-r--r-- | deps/qt5/patches/qt5.cr206850.patch | 43 | ||||
-rw-r--r-- | deps/qt5/patches/qt5.glibc224.patch | 33 | ||||
-rw-r--r-- | deps/qt5/patches/qt5.mysql.h.diff | 7 | ||||
-rw-r--r-- | deps/qt5/patches/qt5.qtbug-49061.patch | 80 | ||||
-rw-r--r-- | deps/qt5/patches/qt5.qtbug-51927.patch | 185 | ||||
-rw-r--r-- | deps/qt5/patches/qt5.qtbug-55583.patch | 41 | ||||
-rw-r--r-- | deps/qt5/patches/qt5.qtbug-60558.patch | 32 | ||||
-rw-r--r-- | deps/qt5/patches/qt5.qtbug-61140.patch | 101 | ||||
-rw-r--r-- | deps/qt5/patches/qt5.qtbug-66103.patch | 172 |
9 files changed, 690 insertions, 4 deletions
diff --git a/deps/qt5/patches/qt5.cr206850.patch b/deps/qt5/patches/qt5.cr206850.patch new file mode 100644 index 0000000..1fb71df --- /dev/null +++ b/deps/qt5/patches/qt5.cr206850.patch @@ -0,0 +1,43 @@ +The latest MariaDB versions aren't caught properly by the checks in Qt, which +may cause a regression to appear (regression, because it was already fixed in +Qt by Dan Vratil): this manifests itself in Akonadi losing its connection to +the database if running for long periods of time. + +Until this is fixed in Qt, you may want to apply this patch in your packages: + +https://codereview.qt-project.org/#/c/206850/ + +From 64588c9bae92ef79f9ca5e87653ffb0962691d0d Mon Sep 17 00:00:00 2001 +From: Andy Shaw <andy.shaw@qt.io> +Date: Wed, 27 Sep 2017 09:23:10 +0200 +Subject: [PATCH] Extend the MariaDB define check to cover the later versions too + +Change-Id: Ide89b4e07feb116bf152cbf3f5630d313e8ba0f1 +--- + src/plugins/sqldrivers/mysql/qsql_mysql.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp +index 6e428fb..b2d3e85 100644 +--- a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp ++++ b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp +@@ -1159,14 +1159,14 @@ static void qLibraryInit() + # endif // MYSQL_VERSION_ID + #endif // Q_NO_MYSQL_EMBEDDED + +-#ifdef MARIADB_BASE_VERSION ++#if defined(MARIADB_BASE_VERSION) || defined(MARIADB_VERSION_ID) + qAddPostRoutine(mysql_server_end); + #endif + } + + static void qLibraryEnd() + { +-#if !defined(MARIADB_BASE_VERSION) ++#if !defined(MARIADB_BASE_VERSION) && !defined(MARIADB_VERSION_ID) + # if !defined(Q_NO_MYSQL_EMBEDDED) + # if MYSQL_VERSION_ID > 40000 + # if (MYSQL_VERSION_ID >= 40110 && MYSQL_VERSION_ID < 50000) || MYSQL_VERSION_ID >= 50003 +-- +2.7.4 + diff --git a/deps/qt5/patches/qt5.glibc224.patch b/deps/qt5/patches/qt5.glibc224.patch new file mode 100644 index 0000000..773781a --- /dev/null +++ b/deps/qt5/patches/qt5.glibc224.patch @@ -0,0 +1,33 @@ +From b12ffcd411d4776f7120ccecb3be34344d930d2b Mon Sep 17 00:00:00 2001 +From: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> +Date: Tue, 9 Aug 2016 16:21:29 +0200 +Subject: Do not depend on Linux 4.5 + +Avoid using MADV_FREE that was only recently added to Linux. It will fail when +run on older Linux kernels. + +Change-Id: I9b0369fb31402f088b2327c12f70dd39f5e4c8c0 +Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> +--- + chromium/third_party/WebKit/Source/wtf/PageAllocator.cpp | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/3rdparty/chromium/third_party/WebKit/Source/wtf/PageAllocator.cpp b/src/3rdparty/chromium/third_party/WebKit/Source/wtf/PageAllocator.cpp +index 121b687..be7c3b9 100644 +--- a/src/3rdparty/chromium/third_party/WebKit/Source/wtf/PageAllocator.cpp ++++ b/src/3rdparty/chromium/third_party/WebKit/Source/wtf/PageAllocator.cpp +@@ -39,6 +39,11 @@ + + #include <sys/mman.h> + ++#if OS(LINUX) && defined(MADV_FREE) ++// Added in Linux 4.5, but we don't want to depend on 4.5 at runtime ++#undef MADV_FREE ++#endif ++ + #ifndef MADV_FREE + #define MADV_FREE MADV_DONTNEED + #endif +-- +cgit v1.0-4-g1e03 + diff --git a/deps/qt5/patches/qt5.mysql.h.diff b/deps/qt5/patches/qt5.mysql.h.diff index 41dc9d3..f1cf11b 100644 --- a/deps/qt5/patches/qt5.mysql.h.diff +++ b/deps/qt5/patches/qt5.mysql.h.diff @@ -1,7 +1,6 @@ -diff -Naur qt-everywhere-opensource-src-5.1.0.orig/qtbase/src/sql/drivers/mysql/qsql_mysql_p.h qt-everywhere-opensource-src-5.1.0/qtbase/src/sql/drivers/mysql/qsql_mysql_p.h ---- qt-everywhere-opensource-src-5.1.0.orig/qtbase/src/sql/drivers/mysql/qsql_mysql_p.h 2013-07-02 07:09:52.000000000 +0000 -+++ qt-everywhere-opensource-src-5.1.0/qtbase/src/sql/drivers/mysql/qsql_mysql_p.h 2013-07-21 21:21:01.190172379 +0000 -@@ -60,7 +60,7 @@ +--- qt-everywhere-opensource-src-5.9.0/qtbase/src/plugins/sqldrivers/mysql/qsql_mysql_p.h.orig 2017-05-26 14:43:31.000000000 +0200 ++++ qt-everywhere-opensource-src-5.9.0/qtbase/src/plugins/sqldrivers/mysql/qsql_mysql_p.h 2017-06-17 22:11:34.211899826 +0200 +@@ -57,7 +57,7 @@ #include <QtCore/qt_windows.h> #endif diff --git a/deps/qt5/patches/qt5.qtbug-49061.patch b/deps/qt5/patches/qt5.qtbug-49061.patch new file mode 100644 index 0000000..d006edb --- /dev/null +++ b/deps/qt5/patches/qt5.qtbug-49061.patch @@ -0,0 +1,80 @@ +# +# https://github.com/qt/qtbase/commit/494376f9.patch +# +From 494376f980e96339b6f1eff7c41336ca4d853065 Mon Sep 17 00:00:00 2001 +From: Thiago Macieira <thiago.macieira@intel.com> +Date: Thu, 12 Nov 2015 10:14:51 -0800 +Subject: [PATCH] Stop unloading plugins in QPluginLoader and QFactoryLoader + +QPluginLoader hasn't unloaded in its destructor since Qt 5.0, but we +missed the equivalent code in QFactoryLoader (which bypasses +QPluginLoader). Besides, QPluginLoader::unload() was still doing +unloading, which it won't anymore. + +Not unloading plugins is Qt's policy, as decided during the 5.0 +development process and reaffirmed now in 5.6. This is due to static +data in plugins leaking out and remaining in use past the unloading of +the plugin, causing crashes. + +This does not affect QLibrary and QLibrary::unload(). Those are meant +for non-Qt loadable modules, so unloading them may be safe. + +Task-number: QTBUG-49061 +Discussed-on: http://lists.qt-project.org/pipermail/development/2015-November/023681.html +Change-Id: I461e9fc7199748faa187ffff1416070f138df8db +Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> +Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> +--- + src/corelib/plugin/qfactoryloader.cpp | 6 ++++-- + src/corelib/plugin/qpluginloader.cpp | 5 +++-- + 2 files changed, 7 insertions(+), 4 deletions(-) + +diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp +index 53b38c3..c820d53 100644 +--- a/src/corelib/plugin/qfactoryloader.cpp ++++ b/src/corelib/plugin/qfactoryloader.cpp +@@ -203,10 +203,12 @@ void QFactoryLoader::update() + ++keyUsageCount; + } + } +- if (keyUsageCount || keys.isEmpty()) ++ if (keyUsageCount || keys.isEmpty()) { ++ library->setLoadHints(QLibrary::PreventUnloadHint); // once loaded, don't unload + d->libraryList += library; +- else ++ } else { + library->release(); ++ } + } + } + #else +diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp +index 62067c7..4752f69 100644 +--- a/src/corelib/plugin/qpluginloader.cpp ++++ b/src/corelib/plugin/qpluginloader.cpp +@@ -154,6 +154,7 @@ QPluginLoader::QPluginLoader(const QString &fileName, QObject *parent) + : QObject(parent), d(0), did_load(false) + { + setFileName(fileName); ++ setLoadHints(QLibrary::PreventUnloadHint); + } + + /*! +@@ -348,7 +349,7 @@ static QString locatePlugin(const QString& fileName) + void QPluginLoader::setFileName(const QString &fileName) + { + #if defined(QT_SHARED) +- QLibrary::LoadHints lh; ++ QLibrary::LoadHints lh = QLibrary::PreventUnloadHint; + if (d) { + lh = d->loadHints(); + d->release(); +@@ -394,7 +395,7 @@ QString QPluginLoader::errorString() const + \brief Give the load() function some hints on how it should behave. + + You can give hints on how the symbols in the plugin are +- resolved. By default, none of the hints are set. ++ resolved. By default since Qt 5.7, QLibrary::PreventUnloadHint is set. + + See the documentation of QLibrary::loadHints for a complete + description of how this property works. diff --git a/deps/qt5/patches/qt5.qtbug-51927.patch b/deps/qt5/patches/qt5.qtbug-51927.patch new file mode 100644 index 0000000..d253dc1 --- /dev/null +++ b/deps/qt5/patches/qt5.qtbug-51927.patch @@ -0,0 +1,185 @@ +From 5149aa68eca6ede8836ec4f07a14d22d9da9b161 Mon Sep 17 00:00:00 2001 +From: Mitch Curtis <mitch.curtis@qt.io> +Date: Tue, 13 Sep 2016 12:42:12 +0200 +Subject: Fix crash on exit when using default property aliases with layouts + +The layout was being destroyed before the text, which meant that the +removeItemChangeListener() call never got hit. To ensure that the +listener is always removed, loop through each child in QQuickLayout's +destructor. + +This is a manual cherry-pick of +59c6c0e0b1b5b46747595a58e11311b7393d7e70. + +Task-number: QTBUG-51927 +Change-Id: I669f42beb8c3dd6b4b741cae0b16e017bb3409df +Reviewed-by: J-P Nurmi <jpnurmi@qt.io> +--- + src/imports/layouts/qquicklayout.cpp | 4 ++ + .../qquicklayouts/data/rowlayout/Container.qml | 55 ++++++++++++++++++++++ + .../qquicklayouts/data/rowlayout/ContainerUser.qml | 53 +++++++++++++++++++++ + .../quick/qquicklayouts/data/tst_rowlayout.qml | 12 +++++ + 4 files changed, 124 insertions(+) + create mode 100644 tests/auto/quick/qquicklayouts/data/rowlayout/Container.qml + create mode 100644 tests/auto/quick/qquicklayouts/data/rowlayout/ContainerUser.qml + +diff --git a/src/imports/layouts/qquicklayout.cpp b/src/imports/layouts/qquicklayout.cpp +index abc8f97..9914826 100644 +--- a/src/imports/layouts/qquicklayout.cpp ++++ b/src/imports/layouts/qquicklayout.cpp +@@ -698,6 +698,10 @@ QQuickLayout::QQuickLayout(QQuickLayoutPrivate &dd, QQuickItem *parent) + QQuickLayout::~QQuickLayout() + { + d_func()->m_isReady = false; ++ ++ const auto childItems = d_func()->childItems; ++ for (QQuickItem *child : childItems) ++ QQuickItemPrivate::get(child)->removeItemChangeListener(this, QQuickItemPrivate::SiblingOrder); + } + + QQuickLayoutAttached *QQuickLayout::qmlAttachedProperties(QObject *object) +diff --git a/tests/auto/quick/qquicklayouts/data/rowlayout/Container.qml b/tests/auto/quick/qquicklayouts/data/rowlayout/Container.qml +new file mode 100644 +index 0000000..22205c1 +--- /dev/null ++++ b/tests/auto/quick/qquicklayouts/data/rowlayout/Container.qml +@@ -0,0 +1,55 @@ ++/**************************************************************************** ++** ++** Copyright (C) 2016 The Qt Company Ltd. ++** Contact: http://www.qt.io/licensing/ ++** ++** This file is part of the test suite of the Qt Toolkit. ++** ++** $QT_BEGIN_LICENSE:BSD$ ++** You may use this file under the terms of the BSD license as follows: ++** ++** "Redistribution and use in source and binary forms, with or without ++** modification, are permitted provided that the following conditions are ++** met: ++** * Redistributions of source code must retain the above copyright ++** notice, this list of conditions and the following disclaimer. ++** * Redistributions in binary form must reproduce the above copyright ++** notice, this list of conditions and the following disclaimer in ++** the documentation and/or other materials provided with the ++** distribution. ++** * Neither the name of The Qt Company Ltd nor the names of its ++** contributors may be used to endorse or promote products derived ++** from this software without specific prior written permission. ++** ++** ++** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ++** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ++** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ++** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ++** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ++** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ++** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ++** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ++** ++** $QT_END_LICENSE$ ++** ++****************************************************************************/ ++ ++import QtQuick 2.7 ++import QtQuick.Layouts 1.3 ++ ++Item { ++ objectName: "qtbug51927-window" ++ visible: true ++ ++ default property alias _contents: customContent.data ++ ++ RowLayout { ++ id: customContent ++ objectName: "qtbug51927-columnLayout" ++ anchors.fill: parent ++ } ++} +diff --git a/tests/auto/quick/qquicklayouts/data/rowlayout/ContainerUser.qml b/tests/auto/quick/qquicklayouts/data/rowlayout/ContainerUser.qml +new file mode 100644 +index 0000000..ff7ce62 +--- /dev/null ++++ b/tests/auto/quick/qquicklayouts/data/rowlayout/ContainerUser.qml +@@ -0,0 +1,53 @@ ++/**************************************************************************** ++** ++** Copyright (C) 2016 The Qt Company Ltd. ++** Contact: http://www.qt.io/licensing/ ++** ++** This file is part of the test suite of the Qt Toolkit. ++** ++** $QT_BEGIN_LICENSE:BSD$ ++** You may use this file under the terms of the BSD license as follows: ++** ++** "Redistribution and use in source and binary forms, with or without ++** modification, are permitted provided that the following conditions are ++** met: ++** * Redistributions of source code must retain the above copyright ++** notice, this list of conditions and the following disclaimer. ++** * Redistributions in binary form must reproduce the above copyright ++** notice, this list of conditions and the following disclaimer in ++** the documentation and/or other materials provided with the ++** distribution. ++** * Neither the name of The Qt Company Ltd nor the names of its ++** contributors may be used to endorse or promote products derived ++** from this software without specific prior written permission. ++** ++** ++** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ++** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ++** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ++** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ++** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ++** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ++** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ++** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ++** ++** $QT_END_LICENSE$ ++** ++****************************************************************************/ ++ ++import QtQuick 2.6 ++import QtQuick.Window 2.2 ++ ++Container { ++ visible: true ++ ++ Text { ++ objectName: "qtbug51927-text" ++ text: qsTr("Hello World") ++ anchors.centerIn: parent ++ renderType: Text.QtRendering ++ } ++} +diff --git a/tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml b/tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml +index 33b8fd0..2d4e227 100644 +--- a/tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml ++++ b/tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml +@@ -926,5 +926,17 @@ Item { + waitForRendering(layout) + layout.destroy() + } ++ ++ ++ function test_defaultPropertyAliasCrash() { ++ var containerUserComponent = Qt.createComponent("rowlayout/ContainerUser.qml"); ++ compare(containerUserComponent.status, Component.Ready); ++ ++ var containerUser = containerUserComponent.createObject(testCase); ++ verify(containerUser); ++ ++ // Shouldn't crash. ++ containerUser.destroy(); ++ } + } + } +-- +cgit v1.0-4-g1e03 + diff --git a/deps/qt5/patches/qt5.qtbug-55583.patch b/deps/qt5/patches/qt5.qtbug-55583.patch new file mode 100644 index 0000000..804f538 --- /dev/null +++ b/deps/qt5/patches/qt5.qtbug-55583.patch @@ -0,0 +1,41 @@ +# +# https://github.com/qt/qtbase/commit/84ea00d4.patch +# +From 84ea00d47049d882f2fabf1446ec6c6eb5fe3038 Mon Sep 17 00:00:00 2001 +From: J-P Nurmi <jpnurmi@qt.io> +Date: Tue, 6 Dec 2016 16:30:31 +0100 +Subject: [PATCH] QGtk3Dialog: don't crash on Wayland + +Check if it's an X11 window before calling XSetTransientForHint(). +No transient parent will be set for GTK+ dialogs on Wayland. That +has to be implemented separately. + +Task-number: QTBUG-55583 +Change-Id: Iabc2a72681c8157bb2f2fe500892853aa397106b +Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> +Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> +--- + src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp b/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp +index ba5089a..699b058 100644 +--- a/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp ++++ b/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp +@@ -135,10 +135,12 @@ bool QGtk3Dialog::show(Qt::WindowFlags flags, Qt::WindowModality modality, QWind + + GdkWindow *gdkWindow = gtk_widget_get_window(gtkWidget); + if (parent) { +- GdkDisplay *gdkDisplay = gdk_window_get_display(gdkWindow); +- XSetTransientForHint(gdk_x11_display_get_xdisplay(gdkDisplay), +- gdk_x11_window_get_xid(gdkWindow), +- parent->winId()); ++ if (GDK_IS_X11_WINDOW(gdkWindow)) { ++ GdkDisplay *gdkDisplay = gdk_window_get_display(gdkWindow); ++ XSetTransientForHint(gdk_x11_display_get_xdisplay(gdkDisplay), ++ gdk_x11_window_get_xid(gdkWindow), ++ parent->winId()); ++ } + } + + if (modality != Qt::NonModal) { diff --git a/deps/qt5/patches/qt5.qtbug-60558.patch b/deps/qt5/patches/qt5.qtbug-60558.patch new file mode 100644 index 0000000..2d03920 --- /dev/null +++ b/deps/qt5/patches/qt5.qtbug-60558.patch @@ -0,0 +1,32 @@ +https://github.com/qt/qtbase/commit/f45c6c18.patch + +From f45c6c180463ccb6620e1d273a264f14a1204a93 Mon Sep 17 00:00:00 2001 +From: Thiago Macieira <thiago.macieira@intel.com> +Date: Wed, 3 May 2017 14:08:50 -0700 +Subject: [PATCH] QInternal::unregisterCallback: don't crash on unregistering + during exit + +Task-number: QTBUG-60558 +Change-Id: Ica9894dc9b5e48278fd4fffd14bb34c6d98d2555 +Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> +--- + src/corelib/global/qglobal.cpp | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp +index c37503f3db..22fc20d47e 100644 +--- a/src/corelib/global/qglobal.cpp ++++ b/src/corelib/global/qglobal.cpp +@@ -3988,8 +3988,10 @@ bool QInternal::registerCallback(Callback cb, qInternalCallback callback) + bool QInternal::unregisterCallback(Callback cb, qInternalCallback callback) + { + if (cb >= 0 && cb < QInternal::LastCallback) { +- QInternal_CallBackTable *cbt = global_callback_table(); +- return (bool) cbt->callbacks[cb].removeAll(callback); ++ if (global_callback_table.exists()) { ++ QInternal_CallBackTable *cbt = global_callback_table(); ++ return (bool) cbt->callbacks[cb].removeAll(callback); ++ } + } + return false; + } diff --git a/deps/qt5/patches/qt5.qtbug-61140.patch b/deps/qt5/patches/qt5.qtbug-61140.patch new file mode 100644 index 0000000..17468a9 --- /dev/null +++ b/deps/qt5/patches/qt5.qtbug-61140.patch @@ -0,0 +1,101 @@ +https://github.com/qt/qtbase/commit/744fd39e.patch + +From 744fd39e66b0b44e65a2505d674fa1cda8b205a4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= <tor.arne.vestbo@qt.io> +Date: Fri, 2 Jun 2017 11:09:55 +0200 +Subject: [PATCH] xcb: Don't destroy foreign windows + +We can't rely on virtual dispatch in the destructor. + +Task-number: QTBUG-61140 +Change-Id: Ib1026caf126095778c24254775cb5a0bfecf3a38 +Reviewed-by: Fabian Vogt +Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> +--- + src/plugins/platforms/xcb/qxcbintegration.cpp | 18 +----------------- + src/plugins/platforms/xcb/qxcbwindow.cpp | 16 ++++++++++------ + src/plugins/platforms/xcb/qxcbwindow.h | 12 ++++++++++++ + 3 files changed, 23 insertions(+), 23 deletions(-) + +diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp +index b414bee204..8e3ee20329 100644 +--- a/src/plugins/platforms/xcb/qxcbintegration.cpp ++++ b/src/plugins/platforms/xcb/qxcbintegration.cpp +@@ -214,25 +214,9 @@ QPlatformWindow *QXcbIntegration::createPlatformWindow(QWindow *window) const + return xcbWindow; + } + +-class QXcbForeignWindow : public QXcbWindow +-{ +-public: +- QXcbForeignWindow(QWindow *window, WId nativeHandle) +- : QXcbWindow(window) { m_window = nativeHandle; } +- ~QXcbForeignWindow() {} +- bool isForeignWindow() const override { return true; } +- +-protected: +- // No-ops +- void create() override {} +- void destroy() override {} +-}; +- + QPlatformWindow *QXcbIntegration::createForeignWindow(QWindow *window, WId nativeHandle) const + { +- QXcbWindow *xcbWindow = new QXcbForeignWindow(window, nativeHandle); +- xcbWindow->create(); +- return xcbWindow; ++ return new QXcbForeignWindow(window, nativeHandle); + } + + #ifndef QT_NO_OPENGL +diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp +index 289d0720e7..d6c69d52ef 100644 +--- a/src/plugins/platforms/xcb/qxcbwindow.cpp ++++ b/src/plugins/platforms/xcb/qxcbwindow.cpp +@@ -597,13 +597,17 @@ QXcbWindow::~QXcbWindow() + } + + destroy(); ++} + +- if (isForeignWindow()) { +- if (connection()->mouseGrabber() == this) +- connection()->setMouseGrabber(Q_NULLPTR); +- if (connection()->mousePressWindow() == this) +- connection()->setMousePressWindow(Q_NULLPTR); +- } ++QXcbForeignWindow::~QXcbForeignWindow() ++{ ++ // Clear window so that destroy() does not affect it ++ m_window = 0; ++ ++ if (connection()->mouseGrabber() == this) ++ connection()->setMouseGrabber(nullptr); ++ if (connection()->mousePressWindow() == this) ++ connection()->setMousePressWindow(nullptr); + } + + void QXcbWindow::destroy() +diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h +index 56628094ee..f38343b6c2 100644 +--- a/src/plugins/platforms/xcb/qxcbwindow.h ++++ b/src/plugins/platforms/xcb/qxcbwindow.h +@@ -278,6 +278,18 @@ public Q_SLOTS: + xcb_cursor_t m_currentBitmapCursor = XCB_CURSOR_NONE; + }; + ++class QXcbForeignWindow : public QXcbWindow ++{ ++public: ++ QXcbForeignWindow(QWindow *window, WId nativeHandle) ++ : QXcbWindow(window) { m_window = nativeHandle; } ++ ~QXcbForeignWindow(); ++ bool isForeignWindow() const override { return true; } ++ ++protected: ++ void create() override {} // No-op ++}; ++ + QT_END_NAMESPACE + + Q_DECLARE_METATYPE(QXcbWindow*) diff --git a/deps/qt5/patches/qt5.qtbug-66103.patch b/deps/qt5/patches/qt5.qtbug-66103.patch new file mode 100644 index 0000000..62d1b30 --- /dev/null +++ b/deps/qt5/patches/qt5.qtbug-66103.patch @@ -0,0 +1,172 @@ +https://code.qt.io/cgit/qt/qtbase.git/patch/?id=4a7771f206d4b29be549d3827c36a46679d90de6 + +From 4a7771f206d4b29be549d3827c36a46679d90de6 Mon Sep 17 00:00:00 2001 +From: Eike Hein <hein@kde.org> +Date: Sun, 7 Jan 2018 13:02:01 +0900 +Subject: QSimpleDrag: Fix mouse release coords for delayed event transmission + +On platforms such as XCB, the drag cursor pixmap is shown via a window +(a QShapedPixmapWindow) under the cursor. + +The mouse button release event at the end of the drag is received in +this QXcbWindow, but intercepted by an event filter that QSimpleDrag +installs on the QApplication. It then resends it unmodified(!) after +the drag has ended and the drag pixmap window destroyed, causing it to +be delivered to the new top-level window. + +The local coordinates in the unmodified QMouseEvent are local to the +drag pixmap window and don't match the window it is delayed-transmitted +to. + +This ends up having fatal, user-visible effects particularly in Qt +Quick: QQuickWindow synthesizes a hover event once per frame using +the last received mouse coordinates, here: the release posted by +QSimpleDrag. This is done to update the hover event state for items +under the cursor when the mouse hasn't moved (e.g. QQuickMouseArea:: +containsMouse). The bogus event coordinates in the release event then +usually end up causing an item near the top-left of the QQuickWindow +to assume it is hovered (because drag pixmap windows tend to be small), +even when the mouse cursor is actually far away from it at the end of +the drag. + +This shows up e.g. in the Plasma 5 desktop, where dragging an icon +on the desktop will cause the icon at the top-left of the screen (if +any) to switch to hovered state, as the release coordinates on the +drag pixmap window (showing a dragged icon) fall into the geometry +of the top-left icon. + +QSimpleDrag contains a topLevelAt() function to find the top-level +window under the global cursor coordinates that is not the drag +pixmap window. This is used by the drop event delivery code. + +This patch uses this function to find the relevant top-level window, +then asks it to map the global cusor coordinates to its local +coordinate system, then synthesizes a new QMouseEvent with local +coordinates computed in this fashion. As a result the window now +gets a release event with coordinates that make sense and are +correct. + +Task-number: QTBUG-66103 +Change-Id: I04ebe6ccd4a991fdd4b540ff0227973ea8896a9d +Reviewed-by: Eike Hein <hein@kde.org> +Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> +--- + src/gui/kernel/qsimpledrag.cpp | 32 +++++++++++++++++++++++++++----- + src/gui/kernel/qsimpledrag_p.h | 6 +++--- + 2 files changed, 30 insertions(+), 8 deletions(-) + +diff --git a/src/gui/kernel/qsimpledrag.cpp b/src/gui/kernel/qsimpledrag.cpp +index a1e25dc53c..87d3ba5915 100644 +--- a/src/gui/kernel/qsimpledrag.cpp ++++ b/src/gui/kernel/qsimpledrag.cpp +@@ -58,6 +58,7 @@ + + #include <QtCore/QEventLoop> + #include <QtCore/QDebug> ++#include <QtCore/QLoggingCategory> + + #include <private/qguiapplication_p.h> + #include <private/qdnd_p.h> +@@ -69,6 +70,8 @@ QT_BEGIN_NAMESPACE + + #ifndef QT_NO_DRAGANDDROP + ++Q_LOGGING_CATEGORY(lcDnd, "qt.gui.dnd") ++ + static QWindow* topLevelAt(const QPoint &pos) + { + QWindowList list = QGuiApplication::topLevelWindows(); +@@ -94,10 +97,10 @@ static QWindow* topLevelAt(const QPoint &pos) + */ + + QBasicDrag::QBasicDrag() : +- m_restoreCursor(false), m_eventLoop(0), ++ m_current_window(nullptr), m_restoreCursor(false), m_eventLoop(nullptr), + m_executed_drop_action(Qt::IgnoreAction), m_can_drop(false), +- m_drag(0), m_drag_icon_window(0), m_useCompositing(true), +- m_screen(Q_NULLPTR) ++ m_drag(nullptr), m_drag_icon_window(nullptr), m_useCompositing(true), ++ m_screen(nullptr) + { + } + +@@ -161,6 +164,7 @@ bool QBasicDrag::eventFilter(QObject *o, QEvent *e) + return true; // Eat all mouse move events + } + case QEvent::MouseButtonRelease: ++ { + disableEventFilter(); + if (canDrop()) { + QPoint nativePosition = getNativeMousePos(e, m_drag_icon_window); +@@ -169,8 +173,25 @@ bool QBasicDrag::eventFilter(QObject *o, QEvent *e) + cancel(); + } + exitDndEventLoop(); +- QCoreApplication::postEvent(o, new QMouseEvent(*static_cast<QMouseEvent *>(e))); ++ ++ // If a QShapedPixmapWindow (drag feedback) is being dragged along, the ++ // mouse event's localPos() will be relative to that, which is useless. ++ // We want a position relative to the window where the drag ends, if possible (?). ++ // If there is no such window (belonging to this Qt application), ++ // make the event relative to the window where the drag started. (QTBUG-66103) ++ const QMouseEvent *release = static_cast<QMouseEvent *>(e); ++ const QWindow *releaseWindow = topLevelAt(release->globalPos()); ++ qCDebug(lcDnd) << "mouse released over" << releaseWindow << "after drag from" << m_current_window << "globalPos" << release->globalPos(); ++ if (!releaseWindow) ++ releaseWindow = m_current_window; ++ QPoint releaseWindowPos = (releaseWindow ? releaseWindow->mapFromGlobal(release->globalPos()) : release->globalPos()); ++ QMouseEvent *newRelease = new QMouseEvent(release->type(), ++ releaseWindowPos, releaseWindowPos, release->screenPos(), ++ release->button(), release->buttons(), ++ release->modifiers(), release->source()); ++ QCoreApplication::postEvent(o, newRelease); + return true; // defer mouse release events until drag event loop has returned ++ } + case QEvent::MouseButtonDblClick: + case QEvent::Wheel: + return true; +@@ -349,7 +370,7 @@ static inline QPoint fromNativeGlobalPixels(const QPoint &point) + into account. + */ + +-QSimpleDrag::QSimpleDrag() : m_current_window(0) ++QSimpleDrag::QSimpleDrag() + { + } + +@@ -373,6 +394,7 @@ void QSimpleDrag::startDrag() + updateCursor(Qt::IgnoreAction); + } + setExecutedDropAction(Qt::IgnoreAction); ++ qCDebug(lcDnd) << "drag began from" << m_current_window<< "cursor pos" << QCursor::pos() << "can drop?" << canDrop(); + } + + void QSimpleDrag::cancel() +diff --git a/src/gui/kernel/qsimpledrag_p.h b/src/gui/kernel/qsimpledrag_p.h +index 0b8a0bc703..bbd7f7f4bb 100644 +--- a/src/gui/kernel/qsimpledrag_p.h ++++ b/src/gui/kernel/qsimpledrag_p.h +@@ -105,6 +105,9 @@ protected: + + QDrag *drag() const { return m_drag; } + ++protected: ++ QWindow *m_current_window; ++ + private: + void enableEventFilter(); + void disableEventFilter(); +@@ -132,9 +135,6 @@ protected: + virtual void cancel() Q_DECL_OVERRIDE; + virtual void move(const QPoint &globalPos) Q_DECL_OVERRIDE; + virtual void drop(const QPoint &globalPos) Q_DECL_OVERRIDE; +- +-private: +- QWindow *m_current_window; + }; + + #endif // QT_NO_DRAGANDDROP +-- +cgit v1.1-6-g87c4 + + |