From a0871ad225bc0a7ceed67fa2eb5ed16e475ebd93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 27 Nov 2017 11:40:12 +0100 Subject: [PATCH 01/18] iOS: Deliver all QWindowSystemInterface events synchronously On iOS we want all delivery of events from the system to be handled synchronously, as that's what the system expects. We don't need to add a delivery template argument to each function in QWindowSystemInterface that we want to delivery synchronously; that's only needed for functions that a platform normally sends asynch, but in some cases want to delivery synchronously. For always delivering events synchronously we just need to change the default delivery method. The only events affected by this are the screen changes, and window state change, which were not synchronous before, but should be. All other events were already synchronous, though either explicit delivery, of a flush. Change-Id: Ib20ca342d1c076be0fbcf018c83735a416769cfe Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/ios/qiosapplicationstate.mm | 2 +- src/plugins/platforms/ios/qioseventdispatcher.mm | 2 ++ src/plugins/platforms/ios/qiostextresponder.mm | 1 - src/plugins/platforms/ios/quiview.mm | 14 +++++++------- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/plugins/platforms/ios/qiosapplicationstate.mm b/src/plugins/platforms/ios/qiosapplicationstate.mm index 13e7e1150fb..7c8e1f9927c 100644 --- a/src/plugins/platforms/ios/qiosapplicationstate.mm +++ b/src/plugins/platforms/ios/qiosapplicationstate.mm @@ -75,7 +75,7 @@ static void handleApplicationStateChanged(UIApplicationState uiApplicationState) { Qt::ApplicationState state = qtApplicationState(uiApplicationState); qCDebug(lcQpaApplication) << "moved to" << state; - QWindowSystemInterface::handleApplicationStateChanged(state); + QWindowSystemInterface::handleApplicationStateChanged(state); } QT_BEGIN_NAMESPACE diff --git a/src/plugins/platforms/ios/qioseventdispatcher.mm b/src/plugins/platforms/ios/qioseventdispatcher.mm index f49f81912e5..429b7d95916 100644 --- a/src/plugins/platforms/ios/qioseventdispatcher.mm +++ b/src/plugins/platforms/ios/qioseventdispatcher.mm @@ -422,6 +422,8 @@ QIOSEventDispatcher::QIOSEventDispatcher(QObject *parent) , m_processEventLevel(0) , m_runLoopExitObserver(this, &QIOSEventDispatcher::handleRunLoopExit, kCFRunLoopExit) { + // We want all delivery of events from the system to be handled synchronously + QWindowSystemInterface::setSynchronousWindowSystemEvents(true); } bool __attribute__((returns_twice)) QIOSEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags) diff --git a/src/plugins/platforms/ios/qiostextresponder.mm b/src/plugins/platforms/ios/qiostextresponder.mm index 001985a1287..33a0b6a42e1 100644 --- a/src/plugins/platforms/ios/qiostextresponder.mm +++ b/src/plugins/platforms/ios/qiostextresponder.mm @@ -377,7 +377,6 @@ QScopedValueRollback rollback(m_inSendEventToFocusObject, true); QWindowSystemInterface::handleKeyEvent(qApp->focusWindow(), QEvent::KeyPress, key, modifiers); QWindowSystemInterface::handleKeyEvent(qApp->focusWindow(), QEvent::KeyRelease, key, modifiers); - QWindowSystemInterface::flushWindowSystemEvents(); } #ifndef QT_NO_SHORTCUT diff --git a/src/plugins/platforms/ios/quiview.mm b/src/plugins/platforms/ios/quiview.mm index bf26feac9f3..a405fecee28 100644 --- a/src/plugins/platforms/ios/quiview.mm +++ b/src/plugins/platforms/ios/quiview.mm @@ -166,7 +166,7 @@ QWindow *window = m_qioswindow->window(); qCDebug(lcQpaWindow) << m_qioswindow->window() << "new geometry is" << actualGeometry; - QWindowSystemInterface::handleGeometryChange(window, actualGeometry, previousGeometry); + QWindowSystemInterface::handleGeometryChange(window, actualGeometry, previousGeometry); if (actualGeometry.size() != previousGeometry.size()) { // Trigger expose event on resize @@ -199,7 +199,7 @@ } qCDebug(lcQpaWindow) << m_qioswindow->window() << region << "isExposed" << m_qioswindow->isExposed(); - QWindowSystemInterface::handleExposeEvent(m_qioswindow->window(), region); + QWindowSystemInterface::handleExposeEvent(m_qioswindow->window(), region); } // ------------------------------------------------------------------------- @@ -230,7 +230,7 @@ } if (qGuiApp->focusWindow() != m_qioswindow->window()) - QWindowSystemInterface::handleWindowActivated(m_qioswindow->window()); + QWindowSystemInterface::handleWindowActivated(m_qioswindow->window()); else qImDebug() << m_qioswindow->window() << "already active, not sending window activation"; @@ -268,7 +268,7 @@ UIResponder *newResponder = FirstResponderCandidate::currentCandidate(); if ([self responderShouldTriggerWindowDeactivation:newResponder]) - QWindowSystemInterface::handleWindowActivated(0); + QWindowSystemInterface::handleWindowActivated(0); return YES; } @@ -359,7 +359,7 @@ - (void)sendTouchEventWithTimestamp:(ulong)timeStamp { QIOSIntegration *iosIntegration = QIOSIntegration::instance(); - QWindowSystemInterface::handleTouchEvent(m_qioswindow->window(), timeStamp, iosIntegration->touchDevice(), m_activeTouches.values()); + QWindowSystemInterface::handleTouchEvent(m_qioswindow->window(), timeStamp, iosIntegration->touchDevice(), m_activeTouches.values()); } - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event @@ -438,7 +438,7 @@ NSTimeInterval timestamp = event ? event.timestamp : [[NSProcessInfo processInfo] systemUptime]; QIOSIntegration *iosIntegration = static_cast(QGuiApplicationPrivate::platformIntegration()); - QWindowSystemInterface::handleTouchCancelEvent(m_qioswindow->window(), ulong(timestamp * 1000), iosIntegration->touchDevice()); + QWindowSystemInterface::handleTouchCancelEvent(m_qioswindow->window(), ulong(timestamp * 1000), iosIntegration->touchDevice()); } - (int)mapPressTypeToKey:(UIPress*)press @@ -466,7 +466,7 @@ int key = [self mapPressTypeToKey:press]; if (key == Qt::Key_unknown) continue; - if (QWindowSystemInterface::handleKeyEvent(m_qioswindow->window(), type, key, Qt::NoModifier)) + if (QWindowSystemInterface::handleKeyEvent(m_qioswindow->window(), type, key, Qt::NoModifier)) handled = true; } From 67391f0a572ddc9c53bdff35dac893b07a862fe5 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 22 Nov 2017 01:05:52 +0100 Subject: [PATCH 02/18] Fix aliasing problem in QVector::removeAll() Since removeAll() takes its argument by cref, if passing a reference to an element of the container to removeAll(), the element may be deleted (overwritten) by anyother value, leading to UB. Add a test that actually happens to fail for me without the patch, even though that might not be guaranteed (we may invoke UB). Change-Id: If8c795113aeb515f4a9bdf1e072395b932295667 Reviewed-by: Thiago Macieira --- src/corelib/tools/qvector.h | 5 +++-- tests/auto/corelib/tools/qvector/tst_qvector.cpp | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index da15d401e3d..74c37faad08 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -164,9 +164,10 @@ public: const const_iterator ce = this->cend(), cit = std::find(this->cbegin(), ce, t); if (cit == ce) return 0; - // next operation detaches, so ce, cit may become invalidated: + // next operation detaches, so ce, cit, t may become invalidated: + const T tCopy = t; const int firstFoundIdx = std::distance(this->cbegin(), cit); - const iterator e = end(), it = std::remove(begin() + firstFoundIdx, e, t); + const iterator e = end(), it = std::remove(begin() + firstFoundIdx, e, tCopy); const int result = std::distance(it, e); erase(it, e); return result; diff --git a/tests/auto/corelib/tools/qvector/tst_qvector.cpp b/tests/auto/corelib/tools/qvector/tst_qvector.cpp index 374fec221ed..6975452d765 100644 --- a/tests/auto/corelib/tools/qvector/tst_qvector.cpp +++ b/tests/auto/corelib/tools/qvector/tst_qvector.cpp @@ -245,6 +245,7 @@ private slots: void qhashInt() const { qhash(); } void qhashMovable() const { qhash(); } void qhashCustom() const { qhash(); } + void removeAllWithAlias() const; void removeInt() const; void removeMovable() const; void removeCustom() const; @@ -1722,6 +1723,13 @@ void tst_QVector::prependCustom() const QCOMPARE(instancesCount, Custom::counter.loadAcquire()); } +void tst_QVector::removeAllWithAlias() const +{ + QVector strings; + strings << "One" << "Two" << "Three" << "One" /* must be distinct, but equal */; + QCOMPARE(strings.removeAll(strings.front()), 2); // will trigger asan/ubsan +} + template void tst_QVector::remove() const { From 41667f7f14bb6f40d14d240c9f74d87de8435398 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 30 Oct 2017 10:53:03 +0100 Subject: [PATCH 03/18] Android: fix scrolling using a touch keyboard on Blackberry This is a follow-up commit to 97eec16e. Blackberry tries sending touchpad events first, and if not consumed, it sends synthetic mouse wheel events as a fallback. This makes touch keyboard scrolling work in native Android ListViews and other views that do not handle SOURCE_TOUCHPAD motion events. Qt apps, however, blindly accepted all generic motion events, so synthesized mouse wheel events were never sent. => Make QtSurface & QtNative accept only those motions events that are actually handled. Task-number: QTBUG-51165 Change-Id: Iefbbf1e3e1cc3da86afc4c87c19671cc6c5fa145 Reviewed-by: Kai Uwe Broulik Reviewed-by: BogDan Vatra --- src/android/jar/src/org/qtproject/qt5/android/QtNative.java | 5 +++-- src/android/jar/src/org/qtproject/qt5/android/QtSurface.java | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java index 902e2f68e7b..ab6d556768c 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java @@ -471,15 +471,16 @@ public class QtNative } } - static public void sendGenericMotionEvent(MotionEvent event, int id) + static public boolean sendGenericMotionEvent(MotionEvent event, int id) { if (event.getActionMasked() != MotionEvent.ACTION_SCROLL || (event.getSource() & InputDevice.SOURCE_CLASS_POINTER) != InputDevice.SOURCE_CLASS_POINTER) { - return; + return false; } mouseWheel(id, (int) event.getX(), (int) event.getY(), event.getAxisValue(MotionEvent.AXIS_HSCROLL), event.getAxisValue(MotionEvent.AXIS_VSCROLL)); + return true; } public static Context getContext() { diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtSurface.java b/src/android/jar/src/org/qtproject/qt5/android/QtSurface.java index e994002dd35..08b5a80f7e8 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtSurface.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtSurface.java @@ -116,7 +116,6 @@ public class QtSurface extends SurfaceView implements SurfaceHolder.Callback @Override public boolean onGenericMotionEvent(MotionEvent event) { - QtNative.sendGenericMotionEvent(event, getId()); - return true; + return QtNative.sendGenericMotionEvent(event, getId()); } } From 60dfd59a606b7c4de0c7fc90d1cda49bc15fe1f0 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 22 Nov 2017 13:22:19 -0800 Subject: [PATCH 04/18] gui/configure.json: Make -{system,qt}-xcb force enabling xcb ... just like -xcb does implicitly. Otherwise, failure to detect system-xcb would silently fall back to -no-xcb despite obviously contradicting the user's request (-qt-xcb always worked anyway, as there is no test that can fail). Change-Id: I6f3145fac0881e7847c4a70547fce206e797a9bb Reviewed-by: Jake Petroules --- src/gui/configure.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/configure.json b/src/gui/configure.json index 28c8034c75c..0664cb92c67 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -1157,6 +1157,7 @@ "label": "XCB", "section": "Platform plugins", "autoDetect": "!config.darwin", + "enable": "input.xcb == 'system' || input.xcb == 'qt'", "condition": "libs.xcb", "output": [ "privateFeature" ] }, From b764c4d0aaab71efec10166a47b31b26f84cf4fb Mon Sep 17 00:00:00 2001 From: Joni Poikelin Date: Fri, 20 Oct 2017 15:55:34 +0300 Subject: [PATCH 05/18] Fix unix QPrintDialog initially selected printer Unix QPrintDialog always set default printer as selected printer even though something was explicitly requested. [ChangeLog][QtPrintSupport][QPrintDialog] Properly pre-select explicitly requested printer on Unix. Task-number: QTBUG-63933 Change-Id: I6289f759d480b4891f4ddd7ff5aad3ae9ab4bc75 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/printsupport/dialogs/qprintdialog_unix.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp index 71312d65f1e..a05c9ac83a0 100644 --- a/src/printsupport/dialogs/qprintdialog_unix.cpp +++ b/src/printsupport/dialogs/qprintdialog_unix.cpp @@ -675,7 +675,9 @@ QUnixPrintWidgetPrivate::QUnixPrintWidgetPrivate(QUnixPrintWidget *p, QPrinter * widget.printers->addItems(printers); - const int idx = printers.indexOf(defaultPrinter); + const QString selectedPrinter = prn && !prn->printerName().isEmpty() ? prn->printerName() : defaultPrinter; + const int idx = printers.indexOf(selectedPrinter); + if (idx >= 0) currentPrinterIndex = idx; } From 3acf5d61a14b70285625bc5276a842fc86f0c7af Mon Sep 17 00:00:00 2001 From: Joni Poikelin Date: Wed, 6 Sep 2017 14:01:39 +0300 Subject: [PATCH 06/18] Fix DB2 plugin building on Linux 64bit Task-number: QTBUG-59358 Change-Id: I2e7d52b31f354868c8c4435d8cabe3525d22ede2 Reviewed-by: Andy Shaw --- src/plugins/sqldrivers/db2/db2.pro | 2 ++ src/plugins/sqldrivers/db2/qsql_db2.cpp | 28 ++++++++++++------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/plugins/sqldrivers/db2/db2.pro b/src/plugins/sqldrivers/db2/db2.pro index eef65fac668..b99fe91fe32 100644 --- a/src/plugins/sqldrivers/db2/db2.pro +++ b/src/plugins/sqldrivers/db2/db2.pro @@ -7,5 +7,7 @@ QMAKE_USE += db2 OTHER_FILES += db2.json +equals(QT_ARCH, x86_64): DEFINES += ODBC64 + PLUGIN_CLASS_NAME = QDB2DriverPlugin include(../qsqldriverbase.pri) diff --git a/src/plugins/sqldrivers/db2/qsql_db2.cpp b/src/plugins/sqldrivers/db2/qsql_db2.cpp index 27d0e7001af..839d80466ff 100644 --- a/src/plugins/sqldrivers/db2/qsql_db2.cpp +++ b/src/plugins/sqldrivers/db2/qsql_db2.cpp @@ -268,7 +268,7 @@ static QSqlField qMakeFieldInfo(const QDB2ResultPrivate* d, int i) { SQLSMALLINT colNameLen; SQLSMALLINT colType; - SQLUINTEGER colSize; + SQLULEN colSize; SQLSMALLINT colScale; SQLSMALLINT nullable; SQLRETURN r = SQL_ERROR; @@ -304,7 +304,7 @@ static int qGetIntData(SQLHANDLE hStmt, int column, bool& isNull) { SQLINTEGER intbuf; isNull = false; - SQLINTEGER lengthIndicator = 0; + SQLLEN lengthIndicator = 0; SQLRETURN r = SQLGetData(hStmt, column + 1, SQL_C_SLONG, @@ -322,7 +322,7 @@ static double qGetDoubleData(SQLHANDLE hStmt, int column, bool& isNull) { SQLDOUBLE dblbuf; isNull = false; - SQLINTEGER lengthIndicator = 0; + SQLLEN lengthIndicator = 0; SQLRETURN r = SQLGetData(hStmt, column+1, SQL_C_DOUBLE, @@ -341,7 +341,7 @@ static SQLBIGINT qGetBigIntData(SQLHANDLE hStmt, int column, bool& isNull) { SQLBIGINT lngbuf = Q_INT64_C(0); isNull = false; - SQLINTEGER lengthIndicator = 0; + SQLLEN lengthIndicator = 0; SQLRETURN r = SQLGetData(hStmt, column+1, SQL_C_SBIGINT, @@ -358,7 +358,7 @@ static QString qGetStringData(SQLHANDLE hStmt, int column, int colSize, bool& is { QString fieldVal; SQLRETURN r = SQL_ERROR; - SQLINTEGER lengthIndicator = 0; + SQLLEN lengthIndicator = 0; if (colSize <= 0) colSize = 255; @@ -394,12 +394,12 @@ static QString qGetStringData(SQLHANDLE hStmt, int column, int colSize, bool& is return fieldVal; } -static QByteArray qGetBinaryData(SQLHANDLE hStmt, int column, SQLINTEGER& lengthIndicator, bool& isNull) +static QByteArray qGetBinaryData(SQLHANDLE hStmt, int column, SQLLEN& lengthIndicator, bool& isNull) { QByteArray fieldVal; SQLSMALLINT colNameLen; SQLSMALLINT colType; - SQLUINTEGER colSize; + SQLULEN colSize; SQLSMALLINT colScale; SQLSMALLINT nullable; SQLRETURN r = SQL_ERROR; @@ -633,9 +633,9 @@ bool QDB2Result::exec() { Q_D(QDB2Result); QList tmpStorage; // holds temporary ptrs - QVarLengthArray indicators(boundValues().count()); + QVarLengthArray indicators(boundValues().count()); - memset(indicators.data(), 0, indicators.size() * sizeof(SQLINTEGER)); + memset(indicators.data(), 0, indicators.size() * sizeof(SQLLEN)); setActive(false); setAt(QSql::BeforeFirstRow); SQLRETURN r; @@ -651,7 +651,7 @@ bool QDB2Result::exec() int i; for (i = 0; i < values.count(); ++i) { // bind parameters - only positional binding allowed - SQLINTEGER *ind = &indicators[i]; + SQLLEN *ind = &indicators[i]; if (values.at(i).isNull()) *ind = SQL_NULL_DATA; if (bindValueType(i) & QSql::Out) @@ -996,7 +996,7 @@ QVariant QDB2Result::data(int field) return QVariant(); } SQLRETURN r = 0; - SQLINTEGER lengthIndicator = 0; + SQLLEN lengthIndicator = 0; bool isNull = false; const QSqlField info = d->recInf.field(field); @@ -1109,7 +1109,7 @@ bool QDB2Result::isNull(int i) int QDB2Result::numRowsAffected() { Q_D(const QDB2Result); - SQLINTEGER affectedRowCount = 0; + SQLLEN affectedRowCount = 0; SQLRETURN r = SQLRowCount(d->hStmt, &affectedRowCount); if (r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO) return affectedRowCount; @@ -1238,7 +1238,7 @@ bool QDB2Driver::open(const QString& db, const QString& user, const QString& pas const QString opt(tmp.left(idx)); const QString val(tmp.mid(idx + 1).simplified()); - SQLUINTEGER v = 0; + SQLULEN v = 0; r = SQL_SUCCESS; if (opt == QLatin1String("SQL_ATTR_ACCESS_MODE")) { if (val == QLatin1String("SQL_MODE_READ_ONLY")) { @@ -1622,7 +1622,7 @@ bool QDB2Driver::rollbackTransaction() bool QDB2Driver::setAutoCommit(bool autoCommit) { Q_D(QDB2Driver); - SQLUINTEGER ac = autoCommit ? SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF; + SQLULEN ac = autoCommit ? SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF; SQLRETURN r = SQLSetConnectAttr(d->hDbc, SQL_ATTR_AUTOCOMMIT, reinterpret_cast(ac), From 203fb838038d4c6c33d9e6ed3a45600c6e064e5a Mon Sep 17 00:00:00 2001 From: Robert Szefner Date: Sat, 25 Nov 2017 20:00:18 +0100 Subject: [PATCH 07/18] QSqlQuery: Remove temporary variable in navigation functions Change-Id: I33836a75e1d2e5663f81a33a195d0cb21760e1f8 Reviewed-by: Andy Shaw --- src/sql/kernel/qsqlquery.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/sql/kernel/qsqlquery.cpp b/src/sql/kernel/qsqlquery.cpp index f9cc07daa11..b89d20976fb 100644 --- a/src/sql/kernel/qsqlquery.cpp +++ b/src/sql/kernel/qsqlquery.cpp @@ -649,11 +649,10 @@ bool QSqlQuery::next() { if (!isSelect() || !isActive()) return false; - bool b = false; + switch (at()) { case QSql::BeforeFirstRow: - b = d->sqlResult->fetchFirst(); - return b; + return d->sqlResult->fetchFirst(); case QSql::AfterLastRow: return false; default: @@ -703,13 +702,11 @@ bool QSqlQuery::previous() return false; } - bool b = false; switch (at()) { case QSql::BeforeFirstRow: return false; case QSql::AfterLastRow: - b = d->sqlResult->fetchLast(); - return b; + return d->sqlResult->fetchLast(); default: if (!d->sqlResult->fetchPrevious()) { d->sqlResult->setAt(QSql::BeforeFirstRow); @@ -737,9 +734,7 @@ bool QSqlQuery::first() qWarning("QSqlQuery::seek: cannot seek backwards in a forward only query"); return false; } - bool b = false; - b = d->sqlResult->fetchFirst(); - return b; + return d->sqlResult->fetchFirst(); } /*! @@ -758,9 +753,7 @@ bool QSqlQuery::last() { if (!isSelect() || !isActive()) return false; - bool b = false; - b = d->sqlResult->fetchLast(); - return b; + return d->sqlResult->fetchLast(); } /*! From fb880bbdff7b4ff3ef1a3451d868ce595a14c29f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lund=20Martsum?= Date: Tue, 21 Nov 2017 08:46:57 +0100 Subject: [PATCH 08/18] QMenu: Corner case size fix (high DPI + multi screen) We always need to set the QMenu screen explicit also when it is about to be shown on the primary screen. The reason is QWidget::metric (called from style/sizeHint) may use qApp->devicePixelRatioF() when it does not know about the topLevelWindow. That may not be the same value as DPR on primary screen. It can be argued that it likely is a bug in QWidget::metric, but fixing that looks to be a somewhat dangerous behavior change. Task-number: QTBUG-59794 Change-Id: I6ed0e808aa31bee5b77c0e19ce61a77548fdbb38 Reviewed-by: Morten Kristensen Reviewed-by: Richard Moe Gustavsen Reviewed-by: Olivier Goffart (Woboq GmbH) Reviewed-by: Gabriel de Dietrich --- src/widgets/widgets/qmenu.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 196348f8e8c..cf306e63bd5 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -853,8 +853,7 @@ void QMenuPrivate::adjustMenuScreen(const QPoint &p) // The windowHandle must point to the screen where the menu will be shown. // The (item) size calculations depend on the menu screen, // so a wrong screen would often cause wrong sizes (on high DPI) - const QScreen *primaryScreen = QApplication::primaryScreen(); - const QScreen *currentScreen = q->windowHandle() ? q->windowHandle()->screen() : primaryScreen; + const QScreen *currentScreen = q->windowHandle() ? q->windowHandle()->screen() : nullptr; const int screenNumberForPoint = QApplication::desktop()->screenNumber(p); QScreen *actualScreen = QGuiApplication::screens().at(screenNumberForPoint); if (actualScreen && currentScreen != actualScreen) { From 81908abd5e62d3ee3e24c37801892ef500de2fc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 28 Nov 2017 19:28:36 +0100 Subject: [PATCH 09/18] iOS: Update screen metrics (physical DPI) for the latest set of devices We were missing some recent iPads, and the iPhone 8 Plus and X. Change-Id: Ib65644a277a1cbd75ccb360b79b9ac8af935c741 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/ios/qiosscreen.mm | 32 +++++++++++++++---------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm index 3514bf63bb5..deea4d86a0c 100644 --- a/src/plugins/platforms/ios/qiosscreen.mm +++ b/src/plugins/platforms/ios/qiosscreen.mm @@ -181,12 +181,12 @@ QT_BEGIN_NAMESPACE /*! Returns the model identifier of the device. - - When running under the simulator, the identifier will not - match the simulated device, but will be x86_64 or i386. */ static QString deviceModelIdentifier() { +#if TARGET_OS_SIMULATOR + return QString::fromLocal8Bit(qgetenv("SIMULATOR_MODEL_IDENTIFIER")); +#else static const char key[] = "hw.machine"; size_t size; @@ -196,6 +196,7 @@ static QString deviceModelIdentifier() sysctlbyname(key, &value, &size, NULL, 0); return QString::fromLatin1(value); +#endif } QIOSScreen::QIOSScreen(UIScreen *screen) @@ -210,19 +211,24 @@ QIOSScreen::QIOSScreen(UIScreen *screen) // Based on https://en.wikipedia.org/wiki/List_of_iOS_devices#Display // iPhone (1st gen), 3G, 3GS, and iPod Touch (1st–3rd gen) are 18-bit devices - if (deviceIdentifier.contains(QRegularExpression("^(iPhone1,[12]|iPhone2,1|iPod[1-3],1)$"))) - m_depth = 18; - else - m_depth = 24; + static QRegularExpression lowBitDepthDevices("^(iPhone1,[12]|iPhone2,1|iPod[1-3],1)$"); + m_depth = deviceIdentifier.contains(lowBitDepthDevices) ? 18 : 24; - if (deviceIdentifier.contains(QRegularExpression("^iPhone(7,1|8,2|9,2|9,4)$"))) { - // iPhone Plus models + static QRegularExpression iPhoneXModels("^iPhone(10,[36])$"); + static QRegularExpression iPhonePlusModels("^iPhone(7,1|8,2|9,[24]|10,[25])$"); + static QRegularExpression iPadMiniModels("^iPad(2,[567]|4,[4-9]|5,[12])$"); + + if (deviceIdentifier.contains(iPhoneXModels)) { + m_physicalDpi = 458; + } else if (deviceIdentifier.contains(iPhonePlusModels)) { m_physicalDpi = 401; - } else if (deviceIdentifier.contains(QRegularExpression("^iPad(1,1|2,[1-4]|3,[1-6]|4,[1-3]|5,[3-4]|6,[7-8])$"))) { - // All iPads except the iPad Mini series - m_physicalDpi = 132 * devicePixelRatio(); + } else if (deviceIdentifier.startsWith("iPad")) { + if (deviceIdentifier.contains(iPadMiniModels)) + m_physicalDpi = 163 * devicePixelRatio(); + else + m_physicalDpi = 132 * devicePixelRatio(); } else { - // All non-Plus iPhones, and iPad Minis + // All normal iPhones, and iPods m_physicalDpi = 163 * devicePixelRatio(); } } else { From 038e473cfac43f80bd8d54bb6c6da5bf6391efa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 28 Nov 2017 19:38:31 +0100 Subject: [PATCH 10/18] iOS: Don't treat AppleTV as an iDevice when resolving physical DPI Change-Id: I07ac92a7b2d8c65b7d70a4f2ed5f96f8f4d99ef0 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/ios/qiosscreen.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm index deea4d86a0c..74e81dedf4d 100644 --- a/src/plugins/platforms/ios/qiosscreen.mm +++ b/src/plugins/platforms/ios/qiosscreen.mm @@ -205,9 +205,9 @@ QIOSScreen::QIOSScreen(UIScreen *screen) , m_uiWindow(0) , m_orientationListener(0) { - if (screen == [UIScreen mainScreen]) { - QString deviceIdentifier = deviceModelIdentifier(); + QString deviceIdentifier = deviceModelIdentifier(); + if (screen == [UIScreen mainScreen] && !deviceIdentifier.startsWith("AppleTV")) { // Based on https://en.wikipedia.org/wiki/List_of_iOS_devices#Display // iPhone (1st gen), 3G, 3GS, and iPod Touch (1st–3rd gen) are 18-bit devices From 8f3ad56191880f1f16abde2d3eba546d477083c8 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 28 Nov 2017 13:15:09 +0100 Subject: [PATCH 11/18] [doc] Document QString{,Ref}::split() behavior with empty 'sep' We actually test for this already in tst_QString::split(). Change-Id: I35fe8f90900ea9c8e6251facdb3326b9226348d0 Reviewed-by: Lars Knoll --- src/corelib/doc/snippets/qstring/main.cpp | 12 +++++++++ src/corelib/tools/qstring.cpp | 32 +++++++++++------------ 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/corelib/doc/snippets/qstring/main.cpp b/src/corelib/doc/snippets/qstring/main.cpp index 41ee5a9cef1..c839c10b84f 100644 --- a/src/corelib/doc/snippets/qstring/main.cpp +++ b/src/corelib/doc/snippets/qstring/main.cpp @@ -793,6 +793,18 @@ void Widget::splitCaseSensitiveFunction() QStringList list2 = str.split(',', QString::SkipEmptyParts); // list2: [ "a", "b", "c" ] //! [62] + + //! [62-empty] + QString str = "abc"; + auto parts = str.split(""); + // parts: {"", "a", "b", "c", ""} + //! [62-empty] + + //! [62-slashes] + QString str = "/a/b/c/"; + auto parts = str.split('/'); + // parts: {"", "a", "b", "c", ""} + //! [62-slashes] } void Widget::sprintfFunction() diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 941532658b5..af3d026682b 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -6878,6 +6878,16 @@ static ResultList splitString(const StringSource &source, const QChar *sep, \snippet qstring/main.cpp 62 + If \a sep is empty, split() returns an empty string, followed + by each of the string's characters, followed by another empty string: + + \snippet qstring/main.cpp 62-empty + + To understand this behavior, recall that the empty string matches + everywhere, so the above is qualitatively the same as: + + \snippet qstring/main.cpp 62-slashes + \sa QStringList::join(), section() */ QStringList QString::split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const @@ -6887,15 +6897,10 @@ QStringList QString::split(const QString &sep, SplitBehavior behavior, Qt::CaseS /*! Splits the string into substring references wherever \a sep occurs, and - returns the list of those strings. If \a sep does not match - anywhere in the string, splitRef() returns a single-element vector - containing this string reference. + returns the list of those strings. - \a cs specifies whether \a sep should be matched case - sensitively or case insensitively. - - If \a behavior is QString::SkipEmptyParts, empty entries don't - appear in the result. By default, empty entries are kept. + See QString::split() for how \a sep, \a behavior and \a cs interact to form + the result. \note All references are valid as long this string is alive. Destroying this string will cause all references be dangling pointers. @@ -6926,15 +6931,10 @@ QVector QString::splitRef(QChar sep, SplitBehavior behavior, Qt::Cas /*! Splits the string into substrings references wherever \a sep occurs, and - returns the list of those strings. If \a sep does not match - anywhere in the string, split() returns a single-element vector - containing this string reference. + returns the list of those strings. - \a cs specifies whether \a sep should be matched case - sensitively or case insensitively. - - If \a behavior is QString::SkipEmptyParts, empty entries don't - appear in the result. By default, empty entries are kept. + See QString::split() for how \a sep, \a behavior and \a cs interact to form + the result. \note All references are valid as long this string is alive. Destroying this string will cause all references be dangling pointers. From bc9941db42172b7f55c69bad27a7b6ae378f4e4a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 29 Nov 2017 14:17:58 +0100 Subject: [PATCH 12/18] tst_QNetworkReply: Blacklist putToFtpWithInvalidCredentials for Windows Task-number: QTBUG-62860 Change-Id: Ibf4d7de9eedc2236375ad10ca4bea08055c7ae00 Reviewed-by: Timur Pocheptsov --- tests/auto/network/access/qnetworkreply/BLACKLIST | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/network/access/qnetworkreply/BLACKLIST b/tests/auto/network/access/qnetworkreply/BLACKLIST index 57f33d5863d..d4c83bc40b5 100644 --- a/tests/auto/network/access/qnetworkreply/BLACKLIST +++ b/tests/auto/network/access/qnetworkreply/BLACKLIST @@ -32,6 +32,8 @@ linux windows [putToFtp] windows ci +[putToFtpWithInvalidCredentials] +windows ci [putWithServerClosingConnectionImmediately] windows [qtbug28035browserDoesNotLoadQtProjectOrgCorrectly] From 49597a7b584d707f0c093299ec96c3a0f121513b Mon Sep 17 00:00:00 2001 From: James McDonnell Date: Tue, 17 Oct 2017 16:23:30 -0400 Subject: [PATCH 13/18] Correct the vertex used to calculate v1/v2Frac The NoClip version of the drawTriangle code had the vertices swapped. Task-number: QTBUG-50845 Change-Id: I731dafee6cc140ea017b3b7d1051a27ad3081aa7 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qdistancefield.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/text/qdistancefield.cpp b/src/gui/text/qdistancefield.cpp index 064c2aca7fd..4b5d4a48b67 100644 --- a/src/gui/text/qdistancefield.cpp +++ b/src/gui/text/qdistancefield.cpp @@ -177,8 +177,8 @@ void drawTriangle(qint32 *bits, int width, int height, const QPoint *center, const int y2 = clip == Clip ? qBound(0, v2->y() >> 8, height) : v2->y() >> 8; const int yC = clip == Clip ? qBound(0, center->y() >> 8, height) : center->y() >> 8; - const int v1Frac = clip == Clip ? (y1 << 8) + 0xff - v1->y() : ~v2->y() & 0xff; - const int v2Frac = clip == Clip ? (y2 << 8) + 0xff - v2->y() : ~v1->y() & 0xff; + const int v1Frac = clip == Clip ? (y1 << 8) + 0xff - v1->y() : ~v1->y() & 0xff; + const int v2Frac = clip == Clip ? (y2 << 8) + 0xff - v2->y() : ~v2->y() & 0xff; const int centerFrac = clip == Clip ? (yC << 8) + 0xff - center->y() : ~center->y() & 0xff; int dx1 = 0, x1 = 0, dx2 = 0, x2 = 0; From e195620d7164f40050e0d9454f7dd94f1649dce2 Mon Sep 17 00:00:00 2001 From: Robert Szefner Date: Sat, 25 Nov 2017 19:04:48 +0100 Subject: [PATCH 14/18] QPSQL: Remove semicolon after Q_DECLARE_SQLDRIVER_PRIVATE The semicolon is unnecessary and QtCreator warns of it. Change-Id: I20f803d1ea0136080ff4dc4f7d9863fd8028992e Reviewed-by: Andy Shaw --- src/plugins/sqldrivers/psql/qsql_psql.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/sqldrivers/psql/qsql_psql.cpp b/src/plugins/sqldrivers/psql/qsql_psql.cpp index 8f7d261bdc4..6ba32a0c716 100644 --- a/src/plugins/sqldrivers/psql/qsql_psql.cpp +++ b/src/plugins/sqldrivers/psql/qsql_psql.cpp @@ -229,7 +229,7 @@ class QPSQLResultPrivate : public QSqlResultPrivate { Q_DECLARE_PUBLIC(QPSQLResult) public: - Q_DECLARE_SQLDRIVER_PRIVATE(QPSQLDriver); + Q_DECLARE_SQLDRIVER_PRIVATE(QPSQLDriver) QPSQLResultPrivate(QPSQLResult *q, const QPSQLDriver *drv) : QSqlResultPrivate(q, drv), result(0), From 813fa3f50ff4eb2eef00d5b55366c97651fef3b7 Mon Sep 17 00:00:00 2001 From: Alexander Shevchenko Date: Fri, 24 Nov 2017 22:35:17 +0200 Subject: [PATCH 15/18] unify windows mkspecs: update description Common changes to mingw-w64, ICC on Windows and MSVC toolchains: - update toolchains description similar to 'gcc-base.conf'. Change-Id: Ie456c6cec86c0d1c0107ca84a0fa7855666df91e Reviewed-by: Oswald Buddenhagen --- mkspecs/common/msvc-desktop.conf | 12 ++++++++---- mkspecs/win32-g++/qmake.conf | 2 +- mkspecs/win32-icc/qmake.conf | 9 +++++---- mkspecs/win32-msvc/qmake.conf | 2 +- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/mkspecs/common/msvc-desktop.conf b/mkspecs/common/msvc-desktop.conf index f95a3bbdc8b..5a26add083b 100644 --- a/mkspecs/common/msvc-desktop.conf +++ b/mkspecs/common/msvc-desktop.conf @@ -1,10 +1,14 @@ # -# qmake configuration for Microsoft Visual Studio C/C++ Compiler -# This mkspec is used by the win32-msvc and win32-clang-msvc specs +# This file is used as a basis for the following compilers: # - +# - Microsoft C/C++ Optimizing Compiler (all desktop versions) +# - Intel C++ Compiler on Windows +# - Clang-cl +# +# Baseline: +# +# - Visual Studio 2005 (8.0), VC++ 14.0 # -# Baseline: Visual Studio 2005 (8.0), VC++ 14.0 # Version-specific settings go in msvc-version.conf (loaded by default_pre) # diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf index 185afaaa494..cf43797b95d 100644 --- a/mkspecs/win32-g++/qmake.conf +++ b/mkspecs/win32-g++/qmake.conf @@ -1,7 +1,7 @@ # # qmake configuration for win32-g++ # -# Written for MinGW / gcc 4.6 or higher +# Written for MinGW-w64 / gcc 5.3 or higher # # Cross compile example for i686-w64-mingw32-g++: # configure -xplatform win32-g++ -device-option CROSS_COMPILE=i686-w64-mingw32- diff --git a/mkspecs/win32-icc/qmake.conf b/mkspecs/win32-icc/qmake.conf index ee95f8a866e..a25c979d9af 100644 --- a/mkspecs/win32-icc/qmake.conf +++ b/mkspecs/win32-icc/qmake.conf @@ -1,16 +1,17 @@ # # qmake configuration for win32-icc # -# Written for Intel C++ +# Written for Intel C++ Compiler on Windows / icl 16.0 or higher # -# Use the Visual Studio configuration +# Use the Microsoft (R) C/C++ Optimizing Compiler configuration, +# since ICC on Windows pretends to be MSVC include(../common/msvc-desktop.conf) -# Now override with the Intel compiler settings +# modifications to msvc-desktop.conf -QMAKE_COMPILER += intel_icl # icl pretends to be msvc +QMAKE_COMPILER += intel_icl QMAKE_CC = icl QMAKE_CFLAGS = -nologo -Zm200 /Qprec /Qwd1744,1738,809,3373 diff --git a/mkspecs/win32-msvc/qmake.conf b/mkspecs/win32-msvc/qmake.conf index 1d8b8f0e97f..5c38330add4 100644 --- a/mkspecs/win32-msvc/qmake.conf +++ b/mkspecs/win32-msvc/qmake.conf @@ -1,7 +1,7 @@ # # qmake configuration for win32-msvc # -# Written for Microsoft Visual C++ (all desktop versions) +# Written for Microsoft C/C++ Optimizing Compiler (all desktop versions) # include(../common/msvc-desktop.conf) From 85eef0e5e05e84b1640a1887fe872e3adbc0ac5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 29 Nov 2017 16:12:40 +0100 Subject: [PATCH 16/18] iOS: Improve logging during application startup Change-Id: I15c1980d7c532c94b34e612bb781c8ed5bf096a0 Reviewed-by: Jake Petroules --- src/plugins/platforms/ios/qioseventdispatcher.mm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/plugins/platforms/ios/qioseventdispatcher.mm b/src/plugins/platforms/ios/qioseventdispatcher.mm index 429b7d95916..7194d5bed16 100644 --- a/src/plugins/platforms/ios/qioseventdispatcher.mm +++ b/src/plugins/platforms/ios/qioseventdispatcher.mm @@ -294,7 +294,7 @@ static bool rootLevelRunLoopIntegration() { [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(applicationDidFinishLaunching) + selector:@selector(applicationDidFinishLaunching:) name:UIApplicationDidFinishLaunchingNotification object:nil]; @@ -320,8 +320,10 @@ static bool rootLevelRunLoopIntegration() # error "Unknown processor family" #endif -+ (void)applicationDidFinishLaunching ++ (void)applicationDidFinishLaunching:(NSNotification *)notification { + qCDebug(lcQpaApplication) << "Application launched with options" << notification.userInfo; + if (!isQtApplication()) return; @@ -329,7 +331,7 @@ static bool rootLevelRunLoopIntegration() // We schedule the main-redirection for the next run-loop pass, so that we // can return from this function and let UIApplicationMain finish its job. // This results in running Qt's application eventloop as a nested runloop. - qEventDispatcherDebug() << "Scheduling main() on next run-loop pass"; + qCDebug(lcQpaApplication) << "Scheduling main() on next run-loop pass"; CFRunLoopTimerRef userMainTimer = CFRunLoopTimerCreateWithHandler(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent(), 0, 0, 0, ^(CFRunLoopTimerRef) { user_main_trampoline(); }); CFRunLoopAddTimer(CFRunLoopGetMain(), userMainTimer, kCFRunLoopCommonModes); @@ -339,7 +341,7 @@ static bool rootLevelRunLoopIntegration() switch (setjmp(processEventEnterJumpPoint)) { case kJumpPointSetSuccessfully: - qEventDispatcherDebug() << "Running main() on separate stack"; qIndent(); + qCDebug(lcQpaApplication) << "Running main() on separate stack"; qIndent(); // Redirect the stack pointer to the start of the reserved stack. This ensures // that when we longjmp out of the event dispatcher and continue execution, the @@ -358,7 +360,7 @@ static bool rootLevelRunLoopIntegration() case kJumpedFromEventDispatcherProcessEvents: // We've returned from the longjmp in the event dispatcher, // and the stack has been restored to its old self. - qUnIndent(); qEventDispatcherDebug() << "Returned from processEvents"; + qUnIndent(); qCDebug(lcQpaApplication) << "Returned from processEvents"; if (Q_UNLIKELY(debugStackUsage)) userMainStack.printUsage(); From da50a0b38ceb730ad3c30d600adfe4435a498550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= Date: Sun, 27 Aug 2017 16:22:08 +0200 Subject: [PATCH 17/18] xcb: Set executed drop action when drop is outside the application Task-number: QTBUG-62815 Change-Id: I13ee1a3a7e9515d827d29ada38bc0d396f4800d7 Reviewed-by: Shawn Rutledge --- src/plugins/platforms/xcb/qxcbdrag.cpp | 11 +++++++++++ src/plugins/platforms/xcb/qxcbdrag.h | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/src/plugins/platforms/xcb/qxcbdrag.cpp b/src/plugins/platforms/xcb/qxcbdrag.cpp index 60d142157fb..51d09d89278 100644 --- a/src/plugins/platforms/xcb/qxcbdrag.cpp +++ b/src/plugins/platforms/xcb/qxcbdrag.cpp @@ -170,6 +170,9 @@ void QXcbDrag::init() QXcbCursor::queryPointer(connection(), ¤t_virtual_desktop, 0); drag_types.clear(); + + dropped = false; + canceled = false; } QMimeData *QXcbDrag::platformDropData() @@ -225,6 +228,10 @@ void QXcbDrag::startDrag() void QXcbDrag::endDrag() { QBasicDrag::endDrag(); + if (!dropped && !canceled && canDrop()) { + // Set executed drop action when dropping outside application. + setExecutedDropAction(accepted_drop_action); + } initiatorWindow.clear(); } @@ -1026,6 +1033,8 @@ void QXcbDrag::handleDrop(QPlatformWindow *, const xcb_client_message_event_t *e // reset target_time = XCB_CURRENT_TIME; + + dropped = true; } @@ -1124,6 +1133,8 @@ void QXcbDrag::cancel() // remove canceled object currentDrag()->deleteLater(); + + canceled = true; } // find an ancestor with XdndAware on it diff --git a/src/plugins/platforms/xcb/qxcbdrag.h b/src/plugins/platforms/xcb/qxcbdrag.h index 2d152edf76e..9e1ee465935 100644 --- a/src/plugins/platforms/xcb/qxcbdrag.h +++ b/src/plugins/platforms/xcb/qxcbdrag.h @@ -136,6 +136,10 @@ private: QRect source_sameanswer; bool waiting_for_status; + // helpers for setting executed drop action outside application + bool dropped; + bool canceled; + // top-level window we sent position to last. xcb_window_t current_target; // window to send events to (always valid if current_target) From 6508fdca1dcc7105947befadba272d0fd4bbc27f Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Tue, 28 Nov 2017 13:30:52 +0100 Subject: [PATCH 18/18] ANGLE: D3D11: Fix shared handle support detection for WARP when MinGW is used The MinGW version we support supports IsWindows8OrGreater so that we can check the windows version properly. As the OpenGL detection falls back to WARP in case of RDP it was possible, that shared handles were wrongly stated as supported, which caused crashes in users' code. Task-number: QTBUG-64657 Change-Id: Iaca2bd169f2764cf6ec68a1d36112a735246b29a Reviewed-by: Andre de la Rocha Reviewed-by: Andy Shaw --- .../angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp | 2 +- .../patches/0002-ANGLE-Fix-compilation-with-MinGW.patch | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp index 0173311bc69..5118bdbe9c1 100644 --- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp +++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp @@ -2645,7 +2645,7 @@ bool Renderer11::getShareHandleSupport() const if (deviceType == d3d11::ANGLE_D3D11_DEVICE_TYPE_WARP) { -#if !defined(ANGLE_ENABLE_WINDOWS_STORE) && !defined(__GNUC__) +#ifndef ANGLE_ENABLE_WINDOWS_STORE if (!IsWindows8OrGreater()) { // WARP on Windows 7 doesn't support shared handles diff --git a/src/angle/patches/0002-ANGLE-Fix-compilation-with-MinGW.patch b/src/angle/patches/0002-ANGLE-Fix-compilation-with-MinGW.patch index dc091b0497b..f42ff2141b4 100644 --- a/src/angle/patches/0002-ANGLE-Fix-compilation-with-MinGW.patch +++ b/src/angle/patches/0002-ANGLE-Fix-compilation-with-MinGW.patch @@ -405,15 +405,6 @@ index ea84783..62badcc 100644 if (mD3d11Module) { -@@ -2618,7 +2642,7 @@ bool Renderer11::getShareHandleSupport() const - - if (deviceType == d3d11::ANGLE_D3D11_DEVICE_TYPE_WARP) - { --#ifndef ANGLE_ENABLE_WINDOWS_STORE -+#if !defined(ANGLE_ENABLE_WINDOWS_STORE) && !defined(__GNUC__) - if (!IsWindows8OrGreater()) - { - // WARP on Windows 7 doesn't support shared handles diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.h b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.h index 62e9816..b4e7761 100644 --- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.h