diff --git a/.gitignore b/.gitignore index 9beb257..49631fa 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /qtbase-opensource-src-5.9.4.tar.xz +/qtbase-opensource-src-5.9.6.tar.xz diff --git a/0012-Avoid-providing-bad-pixelDeltas-on-X11.patch b/0012-Avoid-providing-bad-pixelDeltas-on-X11.patch deleted file mode 100644 index c4ed516..0000000 --- a/0012-Avoid-providing-bad-pixelDeltas-on-X11.patch +++ /dev/null @@ -1,68 +0,0 @@ -From d196036024697a75868c1f1626525710495ca428 Mon Sep 17 00:00:00 2001 -From: Allan Sandfeld Jensen -Date: Thu, 23 Nov 2017 14:25:04 +0100 -Subject: [PATCH 12/74] Avoid providing bad pixelDeltas on X11 - -With libinput we now get a hardcoded resolution that is unrelated to -the hardware. So avoid using that as a real pixel delta and document -pixel deltas as being driver specific and unreliable on X11. - -Task-number: QTBUG-59261 -Change-Id: I9fe86d80e7ccd290ed2e4091d7eafa52cb537d34 -Reviewed-by: David Edmundson -Reviewed-by: Marco Martin -Reviewed-by: Gatis Paeglis ---- - src/gui/kernel/qevent.cpp | 1 + - src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 14 ++++++++------ - 2 files changed, 9 insertions(+), 6 deletions(-) - -diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp -index 06d52aa78d..c68f9afa56 100644 ---- a/src/gui/kernel/qevent.cpp -+++ b/src/gui/kernel/qevent.cpp -@@ -971,6 +971,7 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos, - \li scrolling is about to begin, but the distance did not yet change (Qt::ScrollBegin), - \li or scrolling has ended and the distance did not change anymore (Qt::ScrollEnd). - \endlist -+ \note On X11 this value is driver specific and unreliable, use angleDelta() instead - */ - - /*! -diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp -index d1d97affe8..94f543fd39 100644 ---- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp -+++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp -@@ -953,10 +953,12 @@ void QXcbConnection::xi2HandleScrollEvent(void *event, ScrollingDevice &scrollin - double delta = scrollingDevice.lastScrollPosition.y() - value; - scrollingDevice.lastScrollPosition.setY(value); - angleDelta.setY((delta / scrollingDevice.verticalIncrement) * 120); -- // We do not set "pixel" delta if it is only measured in ticks. -- if (scrollingDevice.verticalIncrement > 1) -+ // With most drivers the increment is 1 for wheels. -+ // For libinput it is hardcoded to a useless 15. -+ // For a proper touchpad driver it should be in the same order of magnitude as 120 -+ if (scrollingDevice.verticalIncrement > 15) - rawDelta.setY(delta); -- else if (scrollingDevice.verticalIncrement < -1) -+ else if (scrollingDevice.verticalIncrement < -15) - rawDelta.setY(-delta); - } - } -@@ -965,10 +967,10 @@ void QXcbConnection::xi2HandleScrollEvent(void *event, ScrollingDevice &scrollin - double delta = scrollingDevice.lastScrollPosition.x() - value; - scrollingDevice.lastScrollPosition.setX(value); - angleDelta.setX((delta / scrollingDevice.horizontalIncrement) * 120); -- // We do not set "pixel" delta if it is only measured in ticks. -- if (scrollingDevice.horizontalIncrement > 1) -+ // See comment under vertical -+ if (scrollingDevice.horizontalIncrement > 15) - rawDelta.setX(delta); -- else if (scrollingDevice.horizontalIncrement < -1) -+ else if (scrollingDevice.horizontalIncrement < -15) - rawDelta.setX(-delta); - } - } --- -2.14.3 - diff --git a/0016-CMake-qt5_add_binary_resource-re-run-if-needed.patch b/0016-CMake-qt5_add_binary_resource-re-run-if-needed.patch deleted file mode 100644 index 5bc0a76..0000000 --- a/0016-CMake-qt5_add_binary_resource-re-run-if-needed.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 43e444d1ffac9d63eeb2053465d02ce4a6cc7410 Mon Sep 17 00:00:00 2001 -From: Kevin Funk -Date: Fri, 29 Sep 2017 23:53:29 +0200 -Subject: [PATCH 16/74] CMake: qt5_add_binary_resource: re-run if needed - -qt5_add_binary_resources() macro did not recompile for CMake generated -input before this patch. - -Adding the input files to the DEPENDS option corrects this issue: - -Task-number: QTBUG-60714 -Change-Id: I0f46918c6f1079fed7ee1b21305b18ff38f863f8 -Reviewed-by: David Faure ---- - src/corelib/Qt5CoreMacros.cmake | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake -index 8b65db95cb..8d3dbe3ecf 100644 ---- a/src/corelib/Qt5CoreMacros.cmake -+++ b/src/corelib/Qt5CoreMacros.cmake -@@ -257,7 +257,7 @@ function(QT5_ADD_BINARY_RESOURCES target ) - add_custom_command(OUTPUT ${rcc_destination} - COMMAND ${Qt5Core_RCC_EXECUTABLE} - ARGS ${rcc_options} --binary --name ${target} --output ${rcc_destination} ${infiles} -- DEPENDS ${rc_depends} ${out_depends} VERBATIM) -+ DEPENDS ${rc_depends} ${out_depends} ${infiles} VERBATIM) - add_custom_target(${target} ALL DEPENDS ${rcc_destination}) - endfunction() - --- -2.14.3 - diff --git a/0045-Handle-OOM-condition-in-the-validation-of-plugin-met.patch b/0045-Handle-OOM-condition-in-the-validation-of-plugin-met.patch deleted file mode 100644 index 955e47e..0000000 --- a/0045-Handle-OOM-condition-in-the-validation-of-plugin-met.patch +++ /dev/null @@ -1,90 +0,0 @@ -From e211ab76d766878b4dbe88901b9a7a4a70ce7332 Mon Sep 17 00:00:00 2001 -From: Andre de la Rocha -Date: Thu, 18 Jan 2018 18:43:25 +0100 -Subject: [PATCH 45/74] Handle OOM condition in the validation of plugin - metadata -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -A large plugin dll (e.g., one with many MB of debug info) could cause -a 32-bit application to crash when the entire dll file could not fit -within the address space of the process. The code for validating a -plugin library and retrieving metadata from it first tried to map -the entire file in memory, which failed for large files, returning -NULL. In this case, the code tried then to read the entire file via -QFile::readAll(), which deep below caused a bad_alloc exception in -malloc, resulting in the termination of the application. This change -handles the case where the library could not be mapped into memory, -in spite of memory mapping being supported, by reporting the error -and returning false, making the plugin unavailable. - -[ChangeLog][QtCore][QPluginLoader] Fixed a bug that would cause the -Qt plugin scanning system to allocate too much memory and possibly -crash the process. - -Task-number: QTBUG-65197 -Change-Id: I8c7235d86175c9fcd2b87fcb1151570da9b9ebe3 -Reviewed-by: Jan Arve Sæther ---- - src/corelib/plugin/qlibrary.cpp | 29 +++++++++++++++++++++-------- - 1 file changed, 21 insertions(+), 8 deletions(-) - -diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp -index ebad7f1751..9e6e70756f 100644 ---- a/src/corelib/plugin/qlibrary.cpp -+++ b/src/corelib/plugin/qlibrary.cpp -@@ -237,21 +237,34 @@ static bool findPatternUnloaded(const QString &library, QLibraryPrivate *lib) - if (lib) - lib->errorString = file.errorString(); - if (qt_debug_component()) { -- qWarning("%s: %s", (const char*) QFile::encodeName(library), -+ qWarning("%s: %s", QFile::encodeName(library).constData(), - qPrintable(QSystemError::stdString())); - } - return false; - } - - QByteArray data; -- const char *filedata = 0; - ulong fdlen = file.size(); -- filedata = (char *) file.map(0, fdlen); -+ const char *filedata = reinterpret_cast(file.map(0, fdlen)); -+ - if (filedata == 0) { -- // try reading the data into memory instead -- data = file.readAll(); -- filedata = data.constData(); -- fdlen = data.size(); -+ if (uchar *mapdata = file.map(0, 1)) { -+ file.unmap(mapdata); -+ // Mapping is supported, but failed for the entire file, likely due to OOM. -+ // Return false, as readAll() would cause a bad_alloc and terminate the process. -+ if (lib) -+ lib->errorString = QLibrary::tr("Out of memory while loading plugin '%1'.").arg(library); -+ if (qt_debug_component()) { -+ qWarning("%s: %s", QFile::encodeName(library).constData(), -+ qPrintable(QSystemError::stdString(ENOMEM))); -+ } -+ return false; -+ } else { -+ // Try reading the data into memory instead. -+ data = file.readAll(); -+ filedata = data.constData(); -+ fdlen = data.size(); -+ } - } - - /* -@@ -745,7 +758,7 @@ void QLibraryPrivate::updatePluginState() - if (qt_debug_component()) { - qWarning("In %s:\n" - " Plugin uses incompatible Qt library (%d.%d.%d) [%s]", -- (const char*) QFile::encodeName(fileName), -+ QFile::encodeName(fileName).constData(), - (qt_version&0xff0000) >> 16, (qt_version&0xff00) >> 8, qt_version&0xff, - debug ? "debug" : "release"); - } --- -2.14.3 - diff --git a/0050-glx-Avoid-losing-the-stereo-flag-in-QSurfaceFormat.patch b/0050-glx-Avoid-losing-the-stereo-flag-in-QSurfaceFormat.patch deleted file mode 100644 index 07b48a7..0000000 --- a/0050-glx-Avoid-losing-the-stereo-flag-in-QSurfaceFormat.patch +++ /dev/null @@ -1,31 +0,0 @@ -From a69a0e8254b79c62fad7372e8c14f66d440ad744 Mon Sep 17 00:00:00 2001 -From: Laszlo Agocs -Date: Tue, 23 Jan 2018 10:21:49 +0100 -Subject: [PATCH 50/74] glx: Avoid losing the stereo flag in QSurfaceFormat - -Task-number: QTBUG-59636 -Change-Id: I38394009993e92ab9db853a1450687fc48e471f5 -Reviewed-by: Andy Nichols ---- - src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp -index e2e573f0e1..fc1806f982 100644 ---- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp -+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp -@@ -134,7 +134,11 @@ static void updateFormatFromContext(QSurfaceFormat &format) - } - - format.setProfile(QSurfaceFormat::NoProfile); -+ const bool isStereo = format.testOption(QSurfaceFormat::StereoBuffers); - format.setOptions(QSurfaceFormat::FormatOptions()); -+ // Restore flags that come from the VisualInfo/FBConfig. -+ if (isStereo) -+ format.setOption(QSurfaceFormat::StereoBuffers); - - if (format.renderableType() == QSurfaceFormat::OpenGL) { - if (format.version() < qMakePair(3, 0)) { --- -2.14.3 - diff --git a/0068-QHeaderView-properly-restore-section-data-after-layo.patch b/0068-QHeaderView-properly-restore-section-data-after-layo.patch deleted file mode 100644 index 9d9c6e7..0000000 --- a/0068-QHeaderView-properly-restore-section-data-after-layo.patch +++ /dev/null @@ -1,226 +0,0 @@ -From 3adfcbf1ed9b63c3ce41d7417658db3836fd3530 Mon Sep 17 00:00:00 2001 -From: Christian Ehrlicher -Date: Sun, 21 Jan 2018 19:55:40 +0100 -Subject: [PATCH 68/74] QHeaderView: properly restore section data after - layoutChanged() -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -QHeaderView is doing a complete rebuild of the sections when the layout -changed because everything could have happened. But since layoutChanged -is also called during e.g. sorting, the old data must be restored when -possible. - -Task-number: QTBUG-65478 -Change-Id: I088d4d843cad362b97df6dc5e0dcb9819b13547f -Reviewed-by: Thorbjørn Lund Martsum -Reviewed-by: Richard Moe Gustavsen ---- - src/widgets/itemviews/qheaderview.cpp | 88 ++++++++++++++++------ - src/widgets/itemviews/qheaderview_p.h | 11 +-- - .../itemviews/qheaderview/tst_qheaderview.cpp | 13 +++- - 3 files changed, 82 insertions(+), 30 deletions(-) - -diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp -index 0905a20812..e1aec3f4bd 100644 ---- a/src/widgets/itemviews/qheaderview.cpp -+++ b/src/widgets/itemviews/qheaderview.cpp -@@ -351,7 +351,7 @@ void QHeaderView::setModel(QAbstractItemModel *model) - if (model == this->model()) - return; - Q_D(QHeaderView); -- d->persistentHiddenSections.clear(); -+ d->layoutChangePersistentSections.clear(); - if (d->model && d->model != QAbstractItemModelPrivate::staticEmptyModel()) { - if (d->orientation == Qt::Horizontal) { - QObject::disconnect(d->model, SIGNAL(columnsInserted(QModelIndex,int,int)), -@@ -2072,14 +2072,28 @@ void QHeaderViewPrivate::_q_layoutAboutToBeChanged() - || model->columnCount(root) == 0) - return; - -- if (hiddenSectionSize.count() == 0) -- return; -+ layoutChangePersistentSections.clear(); -+ layoutChangePersistentSections.reserve(std::min(10, sectionItems.count())); -+ // after layoutChanged another section can be last stretched section -+ if (stretchLastSection) { -+ const int visual = visualIndex(lastSectionLogicalIdx); -+ sectionItems[visual].size = lastSectionSize; -+ } -+ for (int i = 0; i < sectionItems.size(); ++i) { -+ const auto &s = sectionItems.at(i); -+ // only add if the section is not default and not visually moved -+ if (s.size == defaultSectionSize && !s.isHidden && s.resizeMode == globalResizeMode) -+ continue; - -- for (int i = 0; i < sectionItems.count(); ++i) -- if (isVisualIndexHidden(i)) // ### note that we are using column or row 0 -- persistentHiddenSections.append(orientation == Qt::Horizontal -- ? model->index(0, logicalIndex(i), root) -- : model->index(logicalIndex(i), 0, root)); -+ // ### note that we are using column or row 0 -+ layoutChangePersistentSections.append({orientation == Qt::Horizontal -+ ? model->index(0, logicalIndex(i), root) -+ : model->index(logicalIndex(i), 0, root), -+ s}); -+ -+ if (layoutChangePersistentSections.size() > 1000) -+ break; -+ } - } - - void QHeaderViewPrivate::_q_layoutChanged() -@@ -2087,25 +2101,57 @@ void QHeaderViewPrivate::_q_layoutChanged() - Q_Q(QHeaderView); - viewport->update(); - -- const auto hiddenSections = persistentHiddenSections; -- persistentHiddenSections.clear(); -- -- clear(); -- q->initializeSections(); -- invalidateCachedSizeHint(); -+ const auto oldPersistentSections = layoutChangePersistentSections; -+ layoutChangePersistentSections.clear(); - -- if (modelIsEmpty()) { -+ const int newCount = modelSectionCount(); -+ const int oldCount = sectionItems.size(); -+ if (newCount == 0) { -+ clear(); -+ if (oldCount != 0) -+ emit q->sectionCountChanged(oldCount, 0); - return; - } - -- for (const auto &index : hiddenSections) { -- if (index.isValid()) { -- const int logical = (orientation == Qt::Horizontal -- ? index.column() -- : index.row()); -- q->setSectionHidden(logical, true); -+ // adjust section size -+ if (newCount != oldCount) { -+ const int min = qBound(0, oldCount, newCount - 1); -+ q->initializeSections(min, newCount - 1); -+ } -+ // reset sections -+ sectionItems.fill(SectionItem(defaultSectionSize, globalResizeMode), newCount); -+ -+ // all hidden sections are in oldPersistentSections -+ hiddenSectionSize.clear(); -+ -+ for (const auto &item : oldPersistentSections) { -+ const auto &index = item.index; -+ if (!index.isValid()) -+ continue; -+ -+ const int newLogicalIndex = (orientation == Qt::Horizontal -+ ? index.column() -+ : index.row()); -+ // the new visualIndices are already adjusted / reset by initializeSections() -+ const int newVisualIndex = visualIndex(newLogicalIndex); -+ auto &newSection = sectionItems[newVisualIndex]; -+ newSection = item.section; -+ -+ if (newSection.isHidden) { -+ // otherwise setSectionHidden will return without doing anything -+ newSection.isHidden = false; -+ q->setSectionHidden(newLogicalIndex, true); - } - } -+ -+ recalcSectionStartPos(); -+ length = headerLength(); -+ -+ if (stretchLastSection) { -+ // force rebuild of stretched section later on -+ lastSectionLogicalIdx = -1; -+ maybeRestorePrevLastSectionAndStretchLast(); -+ } - } - - /*! -diff --git a/src/widgets/itemviews/qheaderview_p.h b/src/widgets/itemviews/qheaderview_p.h -index 8fc8b88aa5..c9c2cf8493 100644 ---- a/src/widgets/itemviews/qheaderview_p.h -+++ b/src/widgets/itemviews/qheaderview_p.h -@@ -231,10 +231,6 @@ public: - : model->rowCount(root)); - } - -- inline bool modelIsEmpty() const { -- return (model->rowCount(root) == 0 || model->columnCount(root) == 0); -- } -- - inline void doDelayedResizeSections() { - if (!delayedResize.isActive()) - delayedResize.start(0, q_func()); -@@ -304,7 +300,6 @@ public: - QLabel *sectionIndicator; - #endif - QHeaderView::ResizeMode globalResizeMode; -- QList persistentHiddenSections; - mutable bool sectionStartposRecalc; - int resizeContentsPrecision; - // header sections -@@ -335,6 +330,11 @@ public: - }; - - QVector sectionItems; -+ struct LayoutChangeItem { -+ QPersistentModelIndex index; -+ SectionItem section; -+ }; -+ QVector layoutChangePersistentSections; - - void createSectionItems(int start, int end, int size, QHeaderView::ResizeMode mode); - void removeSectionsFromSectionItems(int start, int end); -@@ -388,6 +388,7 @@ public: - - }; - Q_DECLARE_TYPEINFO(QHeaderViewPrivate::SectionItem, Q_PRIMITIVE_TYPE); -+Q_DECLARE_TYPEINFO(QHeaderViewPrivate::LayoutChangeItem, Q_MOVABLE_TYPE); - - QT_END_NAMESPACE - -diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp -index 90019a1798..6dae2cf8e4 100644 ---- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp -+++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp -@@ -2251,10 +2251,6 @@ void tst_QHeaderView::QTBUG6058_reset() - - void tst_QHeaderView::QTBUG7833_sectionClicked() - { -- -- -- -- - QTableView tv; - QStandardItemModel *sim = new QStandardItemModel(&tv); - QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(&tv); -@@ -2278,11 +2274,20 @@ void tst_QHeaderView::QTBUG7833_sectionClicked() - tv.horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive); - - tv.setModel(proxyModel); -+ const int section4Size = tv.horizontalHeader()->sectionSize(4) + 1; -+ tv.horizontalHeader()->resizeSection(4, section4Size); - tv.setColumnHidden(5, true); - tv.setColumnHidden(6, true); - tv.horizontalHeader()->swapSections(8, 10); - tv.sortByColumn(1, Qt::AscendingOrder); - -+ QCOMPARE(tv.isColumnHidden(5), true); -+ QCOMPARE(tv.isColumnHidden(6), true); -+ QCOMPARE(tv.horizontalHeader()->sectionsMoved(), true); -+ QCOMPARE(tv.horizontalHeader()->logicalIndex(8), 10); -+ QCOMPARE(tv.horizontalHeader()->logicalIndex(10), 8); -+ QCOMPARE(tv.horizontalHeader()->sectionSize(4), section4Size); -+ - QSignalSpy clickedSpy(tv.horizontalHeader(), SIGNAL(sectionClicked(int))); - QSignalSpy pressedSpy(tv.horizontalHeader(), SIGNAL(sectionPressed(int))); - --- -2.14.3 - diff --git a/0069-QSimpleDrag-Fix-mouse-release-coords-for-delayed-eve.patch b/0069-QSimpleDrag-Fix-mouse-release-coords-for-delayed-eve.patch deleted file mode 100644 index b1efdb1..0000000 --- a/0069-QSimpleDrag-Fix-mouse-release-coords-for-delayed-eve.patch +++ /dev/null @@ -1,170 +0,0 @@ -From 4a7771f206d4b29be549d3827c36a46679d90de6 Mon Sep 17 00:00:00 2001 -From: Eike Hein -Date: Sun, 7 Jan 2018 13:02:01 +0900 -Subject: [PATCH 69/74] 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 -Reviewed-by: Shawn Rutledge ---- - 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 - #include -+#include - - #include - #include -@@ -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(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(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 --- -2.14.3 - diff --git a/0070-Fix-native-QFileDialog-initial-selection-for-remote-.patch b/0070-Fix-native-QFileDialog-initial-selection-for-remote-.patch deleted file mode 100644 index cce6a03..0000000 --- a/0070-Fix-native-QFileDialog-initial-selection-for-remote-.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 4cd90a3579986ae7441c3e982a5f34cdfd92c152 Mon Sep 17 00:00:00 2001 -From: Alex Richardson -Date: Tue, 17 Jan 2017 22:31:04 +0000 -Subject: [PATCH 70/74] Fix native QFileDialog initial selection for remote - URLs - -When using QFileDialog::getOpenFileUrl() with dir set to e.g. -"sftp://foo/bar.cpp" we call q->selectDirectoryUrl("sftp://foo") -followed by q->selectFile("bar.cpp"). -Inside QFileDialog::selectFile() we unconditionally convert "bar.cpp" -to an absolute URL and then call d->selectFile_sys("$CWD/bar.cpp") -This then calls platform integration that detects that an absolute URL -is being passed to selectFile() and therefore overrides the initial -directory. - -Initially reported as https://bugs.kde.org/show_bug.cgi?id=374913 - -This is a regression that appeared some time between Qt 5.7.0 and 5.7.1. -I have not had time to bisect this but the only commit that may have -change behavior in that time range appears to be -007f92c6eef6191c48da0c44916591d48813ae62. - -Change-Id: I6968abe9ed5c5b9de067c453a7e9d2c5cdb3a190 -Reviewed-by: Christoph Resch -Reviewed-by: David Faure ---- - src/widgets/dialogs/qfiledialog.cpp | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp -index 8d37969be4..cb2c534b24 100644 ---- a/src/widgets/dialogs/qfiledialog.cpp -+++ b/src/widgets/dialogs/qfiledialog.cpp -@@ -2830,7 +2830,10 @@ void QFileDialogPrivate::init(const QUrl &directory, const QString &nameFilter, - if (!nameFilter.isEmpty()) - q->setNameFilter(nameFilter); - q->setDirectoryUrl(workingDirectory(directory)); -- q->selectFile(initialSelection(directory)); -+ if (directory.isLocalFile()) -+ q->selectFile(initialSelection(directory)); -+ else -+ q->selectUrl(directory); - - #ifndef QT_NO_SETTINGS - // Try to restore from the FileDialog settings group; if it fails, fall back --- -2.14.3 - diff --git a/0111-opengl-Bail-if-cached-shader-fails-to-load.patch b/0111-opengl-Bail-if-cached-shader-fails-to-load.patch deleted file mode 100644 index 410f1a5..0000000 --- a/0111-opengl-Bail-if-cached-shader-fails-to-load.patch +++ /dev/null @@ -1,87 +0,0 @@ -From ef20989bf05c13b18eba4aac6f464c5be71136fa Mon Sep 17 00:00:00 2001 -From: Antonio Larrosa -Date: Fri, 16 Feb 2018 13:18:42 +0100 -Subject: [PATCH 111/111] opengl: Bail if cached shader fails to load - -QOpenGLProgramBinaryCache::setProgramBinary() should check -GL_LINK_STATUS after glProgramBinary(), but doesn't. - -In practice, this means that SDDM is a white screen, and KDE is just -a gray task bar. - -So far, Qt tries to check this using its internal ::link() function. -But in case the cached binary fails to load, Qt currently attempts to -link the inexistent program, resulting in a zero-length, fixed -pipeline shader. - -Checking this already in ::setProgramBinary() makes the call to -::link() superfluous, so we remove that as well. - -Done-with: Max Staudt -Done-with: Michal Srb -Done-with: Fabian Vogt -Task-number: QTBUG-66420 -Change-Id: Iabb51d0eb2c0c16bde696efff623e57d15f28d82 -Reviewed-by: Jesus Fernandez -Reviewed-by: Laszlo Agocs -(cherry picked from commit fa091640134b3ff99a9eb92df8286d15203122bf) ---- - src/gui/opengl/qopenglprogrambinarycache.cpp | 20 ++++++++++++++++++-- - src/gui/opengl/qopenglshaderprogram.cpp | 8 +------- - 2 files changed, 19 insertions(+), 9 deletions(-) - -diff --git a/src/gui/opengl/qopenglprogrambinarycache.cpp b/src/gui/opengl/qopenglprogrambinarycache.cpp -index 06373e1113..d16173df83 100644 ---- a/src/gui/opengl/qopenglprogrambinarycache.cpp -+++ b/src/gui/opengl/qopenglprogrambinarycache.cpp -@@ -161,10 +161,26 @@ bool QOpenGLProgramBinaryCache::setProgramBinary(uint programId, uint blobFormat - QOpenGLExtraFunctions *funcs = QOpenGLContext::currentContext()->extraFunctions(); - while (funcs->glGetError() != GL_NO_ERROR) { } - funcs->glProgramBinary(programId, blobFormat, p, blobSize); -- int err = funcs->glGetError(); -+ -+ GLenum err = funcs->glGetError(); -+ if (err != GL_NO_ERROR) { -+ qCDebug(DBG_SHADER_CACHE, "Program binary failed to load for program %u, size %d, " -+ "format 0x%x, err = 0x%x", -+ programId, blobSize, blobFormat, err); -+ return false; -+ } -+ GLint linkStatus = 0; -+ funcs->glGetProgramiv(programId, GL_LINK_STATUS, &linkStatus); -+ if (linkStatus != GL_TRUE) { -+ qCDebug(DBG_SHADER_CACHE, "Program binary failed to load for program %u, size %d, " -+ "format 0x%x, linkStatus = 0x%x, err = 0x%x", -+ programId, blobSize, blobFormat, linkStatus, err); -+ return false; -+ } -+ - qCDebug(DBG_SHADER_CACHE, "Program binary set for program %u, size %d, format 0x%x, err = 0x%x", - programId, blobSize, blobFormat, err); -- return err == 0; -+ return true; - } - - #ifdef Q_OS_UNIX -diff --git a/src/gui/opengl/qopenglshaderprogram.cpp b/src/gui/opengl/qopenglshaderprogram.cpp -index cc8af16bfe..3b82baccb3 100644 ---- a/src/gui/opengl/qopenglshaderprogram.cpp -+++ b/src/gui/opengl/qopenglshaderprogram.cpp -@@ -3824,13 +3824,7 @@ bool QOpenGLShaderProgramPrivate::linkBinary() - bool needsCompile = true; - if (binCache.load(cacheKey, q->programId())) { - qCDebug(DBG_SHADER_CACHE, "Program binary received from cache"); -- linkBinaryRecursion = true; -- bool ok = q->link(); -- linkBinaryRecursion = false; -- if (ok) -- needsCompile = false; -- else -- qCDebug(DBG_SHADER_CACHE, "Link failed after glProgramBinary"); -+ needsCompile = false; - } - - bool needsSave = false; --- -2.14.3 - diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 75dffe8..d8c225e 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -54,8 +54,8 @@ BuildRequires: pkgconfig(libsystemd) Name: qt5-qtbase Summary: Qt5 - QtBase components -Version: 5.9.4 -Release: 6%{?dist} +Version: 5.9.6 +Release: 1%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -123,14 +123,6 @@ Patch66: qtbase-mariadb.patch Patch67: https://bugreports.qt.io/secure/attachment/66353/xcberror_filter.patch ## upstream patches (5.9 branch) -Patch112: 0012-Avoid-providing-bad-pixelDeltas-on-X11.patch -Patch116: 0016-CMake-qt5_add_binary_resource-re-run-if-needed.patch -Patch445: 0045-Handle-OOM-condition-in-the-validation-of-plugin-met.patch -Patch150: 0050-glx-Avoid-losing-the-stereo-flag-in-QSurfaceFormat.patch -Patch168: 0068-QHeaderView-properly-restore-section-data-after-layo.patch -Patch169: 0069-QSimpleDrag-Fix-mouse-release-coords-for-delayed-eve.patch -Patch170: 0070-Fix-native-QFileDialog-initial-selection-for-remote-.patch -Patch211: 0111-opengl-Bail-if-cached-shader-fails-to-load.patch # Do not check any files in %%{_qt5_plugindir}/platformthemes/ for requires. # Those themes are there for platform integration. If the required libraries are @@ -378,14 +370,6 @@ Qt5 libraries used for drawing widgets and OpenGL items. %patch67 -p1 -b .xcberror_filter ## upstream patches -%patch112 -p1 -b .0012 -%patch116 -p1 -b .0016 -%patch445 -p1 -b .0045 -%patch150 -p1 -b .0050 -#patch168 -p1 -b .0068 -%patch169 -p1 -b .0069 -%patch170 -p1 -b .0070 -%patch211 -p1 -b .0111 %if 0%{?inject_optflags} ## adjust $RPM_OPT_FLAGS @@ -1003,6 +987,9 @@ fi %changelog +* Mon Jun 11 2018 Rex Dieter - 5.9.6-1 +- 5.9.6 + * Thu Feb 22 2018 Rex Dieter - 5.9.4-6 - use upstreamed version of QOpenGLShaderProgram fix (QTBUG-66420) diff --git a/qtbase-mariadb.patch b/qtbase-mariadb.patch index 84cf11d..17aff47 100644 --- a/qtbase-mariadb.patch +++ b/qtbase-mariadb.patch @@ -1,13 +1,13 @@ -diff -up qtbase-opensource-src-5.9.2/src/plugins/sqldrivers/mysql/qsql_mysql.cpp.rex qtbase-opensource-src-5.9.2/src/plugins/sqldrivers/mysql/qsql_mysql.cpp ---- qtbase-opensource-src-5.9.2/src/plugins/sqldrivers/mysql/qsql_mysql.cpp.rex 2017-10-02 03:43:38.000000000 -0500 -+++ qtbase-opensource-src-5.9.2/src/plugins/sqldrivers/mysql/qsql_mysql.cpp 2017-10-19 14:56:16.752878279 -0500 -@@ -1159,14 +1159,15 @@ static void qLibraryInit() +diff -up qtbase-opensource-src-5.9.6/src/plugins/sqldrivers/mysql/qsql_mysql.cpp.mariadb qtbase-opensource-src-5.9.6/src/plugins/sqldrivers/mysql/qsql_mysql.cpp +--- qtbase-opensource-src-5.9.6/src/plugins/sqldrivers/mysql/qsql_mysql.cpp.mariadb 2018-06-11 10:03:46.720013031 -0500 ++++ qtbase-opensource-src-5.9.6/src/plugins/sqldrivers/mysql/qsql_mysql.cpp 2018-06-11 10:13:52.285354880 -0500 +@@ -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); + qAddPostRoutine([]() { mysql_server_end(); }); #endif } @@ -15,7 +15,6 @@ diff -up qtbase-opensource-src-5.9.2/src/plugins/sqldrivers/mysql/qsql_mysql.cpp { -#if !defined(MARIADB_BASE_VERSION) +#if !defined(MARIADB_BASE_VERSION) && !defined(MARIADB_VERSION_ID) -+//#error should not get here on f27+ says rex # if !defined(Q_NO_MYSQL_EMBEDDED) # if MYSQL_VERSION_ID > 40000 # if (MYSQL_VERSION_ID >= 40110 && MYSQL_VERSION_ID < 50000) || MYSQL_VERSION_ID >= 50003 diff --git a/sources b/sources index c1d5505..31f0eeb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (qtbase-opensource-src-5.9.4.tar.xz) = 82be3af6cbe83458a17a5dc53b9f57e56d9c1dbc1bae11e36c5a44e11b1f4cf62ef609cb775f55bfad7be38fbfeffc9cf12dd557bf7c64cbd26634c024a394dd +SHA512 (qtbase-opensource-src-5.9.6.tar.xz) = e9d4b631abeaaced325c58778e3d2eda08c6804a3788eea826f6ec90b494db0da072e7ae184ebdb00ee504ad41e9f0c9aaadc096219d5fbb1c4833552e42d8bb