Git commit 0bddab73aa2f33f7c3f9ffc7dafa9b39ff70b3fc by Boudewijn Rempt. Committed on 24/09/2018 at 07:12. Pushed by rempt into branch 'master'. Revert "Update Qt to 5.11 on Windows and build with ssl" This reverts commit 9a1849eb160627faa2e4f1da9a433d257ec8773a. M +9 -9 3rdparty/ext_qt/0001-Don-t-request-the-MIME-image-every-time= -Windows-asks.patch D +0 -25 3rdparty/ext_qt/0001-adapted-to-changed-C-API.patch M +7 -7 3rdparty/ext_qt/0002-Hack-always-return-we-support-DIBV5.pat= ch M +15 -15 3rdparty/ext_qt/0003-Hack-for-fullscreen-workaround.patch M +28 -10 3rdparty/ext_qt/CMakeLists.txt A +111 -0 3rdparty/ext_qt/QTBUG-57299.diff M +6 -1466 3rdparty/ext_qt/disable-wintab.diff C +9 -23 3rdparty/ext_qt/gerrit-189539-ANGLE-mingw-fix.patch [from: 3= rdparty/ext_qt/gerrit-212811_qtbase-angle-d3d11-warp-crash-fix.patch - 086%= similarity] M +47 -156 3rdparty/ext_qt/gerrit-212811_qtbase-angle-d3d11-warp-crash-= fix.patch A +11 -0 3rdparty/ext_qt/mac-default.patch A +59 -0 3rdparty/ext_qt/mac_standardpaths_qtbug-61159.diff M +18 -25 3rdparty/ext_qt/macdeploy-qt.diff M +1 -13 3rdparty/ext_qt/qopengldebug-gles.patch A +20 -0 3rdparty/ext_qt/qt-no-motion-compression.diff M +6 -25 3rdparty/ext_qt/qtgui-private-headers.diff https://commits.kde.org/krita/0bddab73aa2f33f7c3f9ffc7dafa9b39ff70b3fc diff --git a/3rdparty/ext_qt/0001-Don-t-request-the-MIME-image-every-time-W= indows-asks.patch b/3rdparty/ext_qt/0001-Don-t-request-the-MIME-image-every= -time-Windows-asks.patch index 3087b975894..b85a007d330 100644 --- a/3rdparty/ext_qt/0001-Don-t-request-the-MIME-image-every-time-Windows-= asks.patch +++ b/3rdparty/ext_qt/0001-Don-t-request-the-MIME-image-every-time-Windows-= asks.patch @@ -1,19 +1,19 @@ -From 715db09b9ec282d149fffc41b16eef68c786c0cb Mon Sep 17 00:00:00 2001 -From: Boudewijn Rempt -Date: Mon, 23 Jul 2018 11:46:49 +0200 -Subject: [PATCH 3/8] Subject: [PATCH 1/2] Don't request the MIME image eve= ry - time Windows asks for the list of supported types +From 674cfce97c4972176d2bcb55d7013c0ac2190029 Mon Sep 17 00:00:00 2001 +From: Dmitry Kazakov +Date: Tue, 21 Jun 2016 14:50:07 +0300 +Subject: [PATCH 1/2] Don't request the MIME image every time Windows asks = for + the list of supported types = -Change-Id: I05516d83dc4e0f192bc94f92cefc722f25dae4d +Change-Id: I05516d83dc4e0f192bc94f92cefc722f25dae4d4 --- qtbase/src/plugins/platforms/windows/qwindowsmime.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) = diff --git a/qtbase/src/plugins/platforms/windows/qwindowsmime.cpp b/qtbas= e/src/plugins/platforms/windows/qwindowsmime.cpp -index 0439797a7..f63376bdf 100644 +index a8264b5..90d646b 100644 --- a/qtbase/src/plugins/platforms/windows/qwindowsmime.cpp +++ b/qtbase/src/plugins/platforms/windows/qwindowsmime.cpp -@@ -1084,12 +1084,15 @@ bool QWindowsMimeImage::canConvertToMime(const QSt= ring &mimeType, IDataObject *p +@@ -1081,12 +1081,15 @@ bool QWindowsMimeImage::canConvertToMime(const QSt= ring &mimeType, IDataObject *p bool QWindowsMimeImage::canConvertFromMime(const FORMATETC &formatetc, co= nst QMimeData *mimeData) const { int cf =3D getCf(formatetc); @@ -33,5 +33,5 @@ index 0439797a7..f63376bdf 100644 = bool QWindowsMimeImage::convertFromMime(const FORMATETC &formatetc, const= QMimeData *mimeData, STGMEDIUM * pmedium) const -- = -2.17.1 +2.6.4 = diff --git a/3rdparty/ext_qt/0001-adapted-to-changed-C-API.patch b/3rdparty= /ext_qt/0001-adapted-to-changed-C-API.patch deleted file mode 100644 index 1aec81ce401..00000000000 --- a/3rdparty/ext_qt/0001-adapted-to-changed-C-API.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 7edf7f22415082303eb6df2c0502152e40cc5135 Mon Sep 17 00:00:00 2001 -From: Dirk Farin -Date: Fri, 25 May 2018 15:59:52 +0200 -Subject: [PATCH 1/3] adapted to changed C++ API - ---- - plugins/impex/heif/HeifExport.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/plugins/impex/heif/HeifExport.cpp b/plugins/impex/heif/HeifEx= port.cpp -index 3c9fae1736..2f4629fc95 100644 ---- a/plugins/impex/heif/HeifExport.cpp -+++ b/plugins/impex/heif/HeifExport.cpp -@@ -93,7 +93,7 @@ public: - { - } - = -- heif_error write(heif::Context&, const void* data, size_t size) overr= ide { -+ heif_error write(const void* data, size_t size) override { - qint64 n =3D m_io->write((const char*)data,size); - if (n !=3D (qint64)size) { - QString error =3D m_io->errorString(); --- = -2.14.1 - diff --git a/3rdparty/ext_qt/0002-Hack-always-return-we-support-DIBV5.patch= b/3rdparty/ext_qt/0002-Hack-always-return-we-support-DIBV5.patch index 8ee9e625f6d..77e57028bd6 100644 --- a/3rdparty/ext_qt/0002-Hack-always-return-we-support-DIBV5.patch +++ b/3rdparty/ext_qt/0002-Hack-always-return-we-support-DIBV5.patch @@ -1,7 +1,7 @@ -From 2101065bc63a4809cf62ce83b318d6fa16cbb6a2 Mon Sep 17 00:00:00 2001 -From: Boudewijn Rempt -Date: Mon, 23 Jul 2018 11:48:03 +0200 -Subject: [PATCH 4/8] Hack: always return we support DIBV5 +From 5e5026beb420018266d3d00fdb530bb714a841a6 Mon Sep 17 00:00:00 2001 +From: Dmitry Kazakov +Date: Tue, 21 Jun 2016 14:50:47 +0300 +Subject: [PATCH 2/2] Hack: always return we support DIBV5 = Asking for the entire image may be too expensive = @@ -11,10 +11,10 @@ Change-Id: I44c38fad73f1bb5859eb58b941054eeb6c3c6b66 1 file changed, 1 insertion(+), 3 deletions(-) = diff --git a/qtbase/src/plugins/platforms/windows/qwindowsmime.cpp b/qtbas= e/src/plugins/platforms/windows/qwindowsmime.cpp -index f63376bdf..3b5c900b6 100644 +index 90d646b..ef97db7 100644 --- a/qtbase/src/plugins/platforms/windows/qwindowsmime.cpp +++ b/qtbase/src/plugins/platforms/windows/qwindowsmime.cpp -@@ -1055,9 +1055,7 @@ QVector QWindowsMimeImage::formatsForMime= (const QString &mimeType, co +@@ -1052,9 +1052,7 @@ QVector QWindowsMimeImage::formatsForMime= (const QString &mimeType, co QVector formatetcs; if (mimeData->hasImage() && mimeType =3D=3D QLatin1String("applicatio= n/x-qt-image")) { //add DIBV5 if image has alpha channel. Do not add CF_PNG here as= it will confuse MS Office (QTBUG47656). @@ -26,5 +26,5 @@ index f63376bdf..3b5c900b6 100644 } if (!formatetcs.isEmpty()) -- = -2.17.1 +2.6.4 = diff --git a/3rdparty/ext_qt/0003-Hack-for-fullscreen-workaround.patch b/3r= dparty/ext_qt/0003-Hack-for-fullscreen-workaround.patch index 88e31714034..d7c8bfb7aed 100644 --- a/3rdparty/ext_qt/0003-Hack-for-fullscreen-workaround.patch +++ b/3rdparty/ext_qt/0003-Hack-for-fullscreen-workaround.patch @@ -1,7 +1,7 @@ -From b7fe5771ed409dfa74b0ea1ace1d98e1562f134c Mon Sep 17 00:00:00 2001 -From: Boudewijn Rempt -Date: Mon, 23 Jul 2018 11:48:49 +0200 -Subject: [PATCH 5/8] Subject: [PATCH 3/4] Hack for fullscreen workaround +From 84a774e00e9d2535fdb8c798d7789130a9a008f6 Mon Sep 17 00:00:00 2001 +From: Michael Abrahams +Date: Wed, 22 Jun 2016 13:37:06 -0400 +Subject: [PATCH 3/4] Hack for fullscreen workaround = https://bugreports.qt.io/browse/QTBUG-41309 --- @@ -9,18 +9,18 @@ https://bugreports.qt.io/browse/QTBUG-41309 1 file changed, 1 insertion(+), 1 deletion(-) = diff --git a/qtbase/src/plugins/platforms/windows/qwindowswindow.cpp b/qtb= ase/src/plugins/platforms/windows/qwindowswindow.cpp -index 3909c64c5..4c794f746 100644 +index 9c6cb53..d0829e3 100644 --- a/qtbase/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/qtbase/src/plugins/platforms/windows/qwindowswindow.cpp -@@ -1956,7 +1956,7 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowSt= ates newState) - const UINT swpf =3D SWP_FRAMECHANGED | SWP_NOACTIVATE; - const bool wasSync =3D testFlag(SynchronousGeometryChange= Event); - setFlag(SynchronousGeometryChangeEvent); -- SetWindowPos(m_data.hwnd, HWND_TOP, r.left(), r.top(), r.= width(), r.height(), swpf); -+ SetWindowPos(m_data.hwnd, HWND_TOP, r.left()-1, r.top()-1= , r.width()+2, r.height()+2, swpf); - if (!wasSync) - clearFlag(SynchronousGeometryChangeEvent); - clearFlag(MaximizeToFullScreen); +@@ -1769,7 +1769,7 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowSt= ate newState) + const UINT swpf =3D SWP_FRAMECHANGED | SWP_NOACTIVATE; + const bool wasSync =3D testFlag(SynchronousGeometryChangeEven= t); + setFlag(SynchronousGeometryChangeEvent); +- SetWindowPos(m_data.hwnd, HWND_TOP, r.left(), r.top(), r.widt= h(), r.height(), swpf); ++ SetWindowPos(m_data.hwnd, HWND_TOP, r.left()-1, r.top()-1, r.= width()+2, r.height()+2, swpf); + if (!wasSync) + clearFlag(SynchronousGeometryChangeEvent); + QWindowSystemInterface::handleGeometryChange(window(), r); -- = -2.17.1 +2.7.4.windows.1 = diff --git a/3rdparty/ext_qt/CMakeLists.txt b/3rdparty/ext_qt/CMakeLists.txt index 89f8b034d05..8326dd4533b 100644 --- a/3rdparty/ext_qt/CMakeLists.txt +++ b/3rdparty/ext_qt/CMakeLists.txt @@ -3,9 +3,9 @@ if (WIN32) list(APPEND _QT_conf -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdoc -skip qtenginio -skip qtgraphical= effects -skip qtlocation -skip qtsensors -skip qtserialport -skip qtwayland - -skip qtwebchannel -skip qtwebsockets + -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwe= bview -skip qtxmlpatterns -no-sql-sqlite -nomake examples -nomake tools - -no-compile-examples -no-dbus -no-iconv -no-qml-debug + -no-compile-examples -no-dbus -no-iconv -no-qml-debug -no-ssl -no-libproxy -no-system-proxies -no-icu -no-mtdev -skip qtcharts -skip qtdatavis3d -skip qtgamepad -skip qtnetworkau= th -skip qtpurchasing -skip qtremoteobjects -skip qtscxml -skip qtser= ialbus @@ -33,15 +33,17 @@ if (WIN32) ExternalProject_Add( ext_qt DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR} - URL https://download.qt.io/official_releases/qt/5.11/5.11.1/single/q= t-everywhere-src-5.11.1.zip - URL_HASH SHA1=3D9b5464e2f42d7a673834950d0f440ca0d048f6a2 + URL https://download.qt.io/archive/qt/5.9/5.9.3/single/qt-everywhere= -opensource-src-5.9.3.zip + URL_HASH SHA1=3D2d3c53cd9dc76a479873548921a20d3d9b6fb9ac PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/d= isable-wintab.diff COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/q= tgui-private-headers.diff COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/0= 001-Don-t-request-the-MIME-image-every-time-Windows-asks.patch COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/0= 002-Hack-always-return-we-support-DIBV5.patch COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/0= 003-Hack-for-fullscreen-workaround.patch COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/q= opengldebug-gles.patch - COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/g= errit-212811_qtbase-angle-d3d11-warp-crash-fix.patch + COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/g= errit-189539-ANGLE-mingw-fix.patch + COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOU= RCE_DIR}/gerrit-212811_qtbase-angle-d3d11-warp-crash-fix.patch + COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOU= RCE_DIR}/QTBUG-57299.diff = INSTALL_DIR ${EXTPREFIX_qt} CONFIGURE_COMMAND /configure.bat ${_QT_conf} @@ -58,8 +60,9 @@ elseif (NOT APPLE) ExternalProject_Add( ext_qt DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR} - URL https://download.qt.io/official_releases/qt/5.11/5.11.1/single/q= t-everywhere-src-5.11.1.tar.xz - URL_MD5 c6f0854d7de7bde80cfd8cc85bb7152b + URL https://download.qt.io/official_releases/qt/5.10/5.10.0/single/q= t-everywhere-src-5.10.0.tar.xz + URL_MD5 c5e275ab0ed7ee61d0f4b82cd471770d + #PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/q= t-no-motion-compression.diff = CONFIGURE_COMMAND /configure -prefix ${EXTPREFIX_qt} -op= ensource -confirm-license -verbose -nomake examples -skip qt3d -skip qtacti= veqt -skip qtcanvas3d -skip qtconnectivity -skip qtenginio -skip qtgraphica= leffects -skip qtlocation -skip qtwayland -skip qtwebchannel -skip qtwebeng= ine -skip qtwebsockets -skip qtwebview -skip qtandroidextras -skip qtserial= port -skip qtdatavis3d -skip qtvirtualkeyboard -skip qtspeech -skip qtsenso= rs -skip qtgamepad -skip qtscxml -skip qtremoteobjects -skip qtxmlpatterns = -skip qtnetworkauth -skip qtcharts -skip qtdatavis3d -skip qtgamepad -skip= qtpurchasing -skip qtscxml -skip qtserialbus -skip qtspeech -skip qtvirtua= lkeyboard INSTALL_DIR ${EXTPREFIX_qt} @@ -156,6 +159,21 @@ else( APPLE ) # # Now configure ext_qt accordingly # + if ((XCRUN_COMMAND_RESULT) AND (NOT (XCODE_VERSION VERSION_LESS 8.0.= 0))) + # Fix Xcode xcrun related issue. + # NOTE: This should be fixed by Qt 5.7.1 see here: http://code.qt.= io/cgit/qt/qtbase.git/commit/?h=3Ddev&id=3D77a71c32c9d19b87f79b208929e71282= e8d8b5d9 + # NOTE: but no one's holding their breath. + set(ext_qt_PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_S= OURCE_DIR}/macdeploy-qt.diff + COMMAND ${PATCH_COMMAND} -p1 -b -d /qtbase -i = ${CMAKE_CURRENT_SOURCE_DIR}/mac_standardpaths_qtbug-61159.diff + #COMMAND ${PATCH_COMMAND} -p1 -b -d /qtbase/mk= specs/features/mac -i ${CMAKE_CURRENT_SOURCE_DIR}/mac-default.patch + ) + message(STATUS "${EXTPREFIX_qt}:Additional patches injected.") + else() + # No extra patches will be applied + # NOTE: defaults for some untested scenarios like xcrun fails and = xcode_version < 8. + # NOTE: that is uncharted territory and (hopefully) a very unlikel= y scenario... + set(ext_qt_PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_S= OURCE_DIR}/macdeploy-qt.diff) + endif() = # Qt is big - try and parallelize if at all possible include(ProcessorCount) @@ -183,10 +201,10 @@ else( APPLE ) LOG_INSTALL ON BUILD_IN_SOURCE ON = - URL https://download.qt.io/official_releases/qt/5.11/5.11.1/single= /qt-everywhere-src-5.11.1.tar.xz - URL_MD5 c6f0854d7de7bde80cfd8cc85bb7152b + URL https://download.qt.io/official_releases/qt/5.10/5.10.0/single= /qt-everywhere-src-5.10.0.tar.xz + URL_MD5 c5e275ab0ed7ee61d0f4b82cd471770d = - PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}= /macdeploy-qt.diff + PATCH_COMMAND ${ext_qt_PATCH_COMMAND} = INSTALL_DIR ${EXTPREFIX_qt} CONFIGURE_COMMAND /configure = diff --git a/3rdparty/ext_qt/QTBUG-57299.diff b/3rdparty/ext_qt/QTBUG-57299= .diff new file mode 100644 index 00000000000..19d62bda7a8 --- /dev/null +++ b/3rdparty/ext_qt/QTBUG-57299.diff @@ -0,0 +1,111 @@ +From 7a5828621ce1f44c6af39257bc62cf6fac5f22c4 Mon Sep 17 00:00:00 2001 +From: Friedemann Kleint +Date: Fri, 26 Jan 2018 08:37:40 +0100 +Subject: [PATCH] Windows/QSaveFile: Fix locking issues on Dropbox drives + +Add a flag to QTemporaryFileEngine causing the file to be opened in +non-shared mode, preventing renaming failures caused by the Dropbox +driver accessing it. + +Task-number: QTBUG-57299 +Change-Id: Id7afc3559fd15784d4166efbbd057d592b5e0ab2 +Reviewed-by: Oswald Buddenhagen +Reviewed-by: Oliver Wolff +Reviewed-by: Thiago Macieira +(cherry picked from commit fe5edcee602f0ab2912bbdd1a21f4309ed7dbfd6) +--- + src/corelib/io/qsavefile.cpp | 2 +- + src/corelib/io/qtemporaryfile.cpp | 11 +++++++---- + src/corelib/io/qtemporaryfile_p.h | 5 +++++ + 3 files changed, 13 insertions(+), 5 deletions(-) + +diff --git a/src/corelib/io/qsavefile.cpp b/src/corelib/io/qsavefile.cpp +index 3f45ca5f913..aaf3d1f5fb1 100644 +--- a/src/corelib/io/qsavefile.cpp ++++ b/src/corelib/io/qsavefile.cpp +@@ -231,7 +231,7 @@ bool QSaveFile::open(OpenMode mode) + d->finalFileName =3D existingFile.filePath(); + } + = +- d->fileEngine =3D new QTemporaryFileEngine; ++ d->fileEngine =3D new QTemporaryFileEngine(QTemporaryFileEngine::Win3= 2NonShared); + // if the target file exists, we'll copy its permissions below, + // but until then, let's ensure the temporary file is not accessible + // to a third party +diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporary= file.cpp +index 8a99873fee1..4712e65a419 100644 +--- a/src/corelib/io/qtemporaryfile.cpp ++++ b/src/corelib/io/qtemporaryfile.cpp +@@ -117,7 +117,7 @@ typedef int NativeFileHandle; + */ + static bool createFileFromTemplate(NativeFileHandle &file, + QFileSystemEntry::NativePath &path, size_t pos, size_t length, qu= int32 mode, +- QSystemError &error) ++ int flags, QSystemError &error) + { + Q_ASSERT(length !=3D 0); + Q_ASSERT(pos < size_t(path.length())); +@@ -151,16 +151,18 @@ static bool createFileFromTemplate(NativeFileHandle = &file, + // Atomically create file and obtain handle + #if defined(Q_OS_WIN) + Q_UNUSED(mode); ++ const DWORD shareMode =3D (flags & QTemporaryFileEngine::Win32Non= Shared) ++ ? 0u : (FILE_SHARE_READ | FILE_SHARE_WRIT= E); + = + # ifndef Q_OS_WINRT + file =3D CreateFile((const wchar_t *)path.constData(), + GENERIC_READ | GENERIC_WRITE, +- FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_NEW, ++ shareMode, NULL, CREATE_NEW, + FILE_ATTRIBUTE_NORMAL, NULL); + # else // !Q_OS_WINRT + file =3D CreateFile2((const wchar_t *)path.constData(), + GENERIC_READ | GENERIC_WRITE, +- FILE_SHARE_READ | FILE_SHARE_WRITE, CREATE_NEW, ++ shareMode, CREATE_NEW, + NULL); + # endif // Q_OS_WINRT + = +@@ -182,6 +184,7 @@ static bool createFileFromTemplate(NativeFileHandle &f= ile, + return false; + } + #else // POSIX ++ Q_UNUSED(flags) + file =3D QT_OPEN(path.constData(), + QT_OPEN_CREAT | O_EXCL | QT_OPEN_RDWR | QT_OPEN_LARGEFILE, + static_cast(mode)); +@@ -342,7 +345,7 @@ bool QTemporaryFileEngine::open(QIODevice::OpenMode op= enMode) + NativeFileHandle &file =3D d->fd; + #endif + = +- if (!createFileFromTemplate(file, filename, phPos, phLength, fileMode= , error)) { ++ if (!createFileFromTemplate(file, filename, phPos, phLength, fileMode= , flags, error)) { + setError(QFile::OpenError, error.toString()); + return false; + } +diff --git a/src/corelib/io/qtemporaryfile_p.h b/src/corelib/io/qtemporary= file_p.h +index 7f365f0e8a1..b0fab3a2558 100644 +--- a/src/corelib/io/qtemporaryfile_p.h ++++ b/src/corelib/io/qtemporaryfile_p.h +@@ -85,6 +85,10 @@ class QTemporaryFileEngine : public QFSFileEngine + { + Q_DECLARE_PRIVATE(QFSFileEngine) + public: ++ enum Flags { Win32NonShared =3D 0x1 }; ++ ++ explicit QTemporaryFileEngine(int _flags =3D 0) : flags(_flags) {} ++ + void initialize(const QString &file, quint32 mode, bool nameIsTemplat= e =3D true) + { + Q_D(QFSFileEngine); +@@ -109,6 +113,7 @@ public: + bool close() override; + = + quint32 fileMode; ++ int flags; + bool filePathIsTemplate; + bool filePathWasTemplate; + }; +-- = +2.16.3 + diff --git a/3rdparty/ext_qt/disable-wintab.diff b/3rdparty/ext_qt/disable-= wintab.diff index 5ffed56ae13..7a986d5da45 100644 --- a/3rdparty/ext_qt/disable-wintab.diff +++ b/3rdparty/ext_qt/disable-wintab.diff @@ -1,19 +1,8 @@ -From c6a6e0d1a3207c5379a4c4118dffe6801f4eb044 Mon Sep 17 00:00:00 2001 -From: Boudewijn Rempt -Date: Mon, 23 Jul 2018 11:41:26 +0200 -Subject: [PATCH 1/8] disable-wintab.diff - ---- - .../platforms/windows/qwindowscontext.cpp | 23 - - .../windows/qwindowscontext.cpp.orig | 1440 +++++++++++++++++ - 2 files changed, 1440 insertions(+), 23 deletions(-) - create mode 100644 qtbase/src/plugins/platforms/windows/qwindowscontext.c= pp.orig - diff --git a/qtbase/src/plugins/platforms/windows/qwindowscontext.cpp b/qt= base/src/plugins/platforms/windows/qwindowscontext.cpp -index 98a4b261f..946df61d8 100644 +index e6e6ee8b1a..89143b6d3f 100644 --- a/qtbase/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/qtbase/src/plugins/platforms/windows/qwindowscontext.cpp -@@ -242,9 +242,6 @@ struct QWindowsContextPrivate { +@@ -240,9 +240,6 @@ struct QWindowsContextPrivate { QWindowsMimeConverter m_mimeConverter; QWindowsScreenManager m_screenManager; QSharedPointer m_creationContext; @@ -21,8 +10,8 @@ index 98a4b261f..946df61d8 100644 - QScopedPointer m_tabletSupport; -#endif const HRESULT m_oleInitializeResult; + const QByteArray m_eventType; QWindow *m_lastActiveWindow =3D nullptr; - bool m_asyncExpose =3D false; @@ -281,17 +278,10 @@ QWindowsContext::QWindowsContext() : const QByteArray bv =3D qgetenv("QT_QPA_VERBOSE"); if (!bv.isEmpty()) @@ -41,7 +30,7 @@ index 98a4b261f..946df61d8 100644 unregisterWindowClasses(); if (d->m_oleInitializeResult =3D=3D S_OK || d->m_oleInitializeResult = =3D=3D S_FALSE) OleUninitialize(); -@@ -332,12 +322,7 @@ bool QWindowsContext::initTouch(unsigned integrationO= ptions) +@@ -337,12 +327,7 @@ bool QWindowsContext::initTouch(unsigned integrationO= ptions) = void QWindowsContext::setTabletAbsoluteRange(int a) { @@ -54,7 +43,7 @@ index 98a4b261f..946df61d8 100644 } = int QWindowsContext::processDpiAwareness() -@@ -708,11 +693,7 @@ QWindowsScreenManager &QWindowsContext::screenManager= () +@@ -702,11 +687,7 @@ QWindowsScreenManager &QWindowsContext::screenManager= () = QWindowsTabletSupport *QWindowsContext::tabletSupport() const { @@ -66,7 +55,7 @@ index 98a4b261f..946df61d8 100644 } = /*! -@@ -1139,10 +1120,6 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT m= essage, +@@ -1112,10 +1093,6 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT m= essage, *result =3D LRESULT(MA_NOACTIVATE); return true; } @@ -77,1452 +66,3 @@ index 98a4b261f..946df61d8 100644 if (platformWindow->testFlag(QWindowsWindow::BlockedByModal)) if (const QWindow *modalWindow =3D QGuiApplication::modalWind= ow()) { QWindowsWindow *platformWindow =3D QWindowsWindow::window= sWindowOf(modalWindow); -diff --git a/qtbase/src/plugins/platforms/windows/qwindowscontext.cpp.orig= b/qtbase/src/plugins/platforms/windows/qwindowscontext.cpp.orig -new file mode 100644 -index 000000000..98a4b261f ---- /dev/null -+++ b/qtbase/src/plugins/platforms/windows/qwindowscontext.cpp.orig -@@ -0,0 +1,1440 @@ -+/************************************************************************= **** -+** -+** Copyright (C) 2013 Samuel Gaist -+** Copyright (C) 2016 The Qt Company Ltd. -+** Contact: https://www.qt.io/licensing/ -+** -+** This file is part of the plugins of the Qt Toolkit. -+** -+** $QT_BEGIN_LICENSE:LGPL$ -+** Commercial License Usage -+** Licensees holding valid commercial Qt licenses may use this file in -+** accordance with the commercial license agreement provided with the -+** Software or, alternatively, in accordance with the terms contained in -+** a written agreement between you and The Qt Company. For licensing terms -+** and conditions see https://www.qt.io/terms-conditions. For further -+** information use the contact form at https://www.qt.io/contact-us. -+** -+** GNU Lesser General Public License Usage -+** Alternatively, this file may be used under the terms of the GNU Lesser -+** General Public License version 3 as published by the Free Software -+** Foundation and appearing in the file LICENSE.LGPL3 included in the -+** packaging of this file. Please review the following information to -+** ensure the GNU Lesser General Public License version 3 requirements -+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -+** -+** GNU General Public License Usage -+** Alternatively, this file may be used under the terms of the GNU -+** General Public License version 2.0 or (at your option) the GNU General -+** Public license version 3 or any later version approved by the KDE Free -+** Qt Foundation. The licenses are as published by the Free Software -+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -+** included in the packaging of this file. Please review the following -+** information to ensure the GNU General Public License requirements will -+** be met: https://www.gnu.org/licenses/gpl-2.0.html and -+** https://www.gnu.org/licenses/gpl-3.0.html. -+** -+** $QT_END_LICENSE$ -+** -+*************************************************************************= ***/ -+ -+#include "qwindowscontext.h" -+#include "qwindowsintegration.h" -+#include "qwindowswindow.h" -+#include "qwindowskeymapper.h" -+#include "qwindowsmousehandler.h" -+#include "qtwindowsglobal.h" -+#include "qwindowsmenu.h" -+#include "qwindowsmime.h" -+#include "qwindowsinputcontext.h" -+#if QT_CONFIG(tabletevent) -+# include "qwindowstabletsupport.h" -+#endif -+#include "qwindowstheme.h" -+#include -+#ifndef QT_NO_ACCESSIBILITY -+# include "uiautomation/qwindowsuiaaccessibility.h" -+#endif -+#if QT_CONFIG(sessionmanager) -+# include -+# include "qwindowssessionmanager.h" -+#endif -+#include "qwindowsscreen.h" -+#include "qwindowstheme.h" -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+#include -+#include -+#include -+#include -+#include -+ -+QT_BEGIN_NAMESPACE -+ -+Q_LOGGING_CATEGORY(lcQpaWindows, "qt.qpa.windows") -+Q_LOGGING_CATEGORY(lcQpaBackingStore, "qt.qpa.backingstore") -+Q_LOGGING_CATEGORY(lcQpaEvents, "qt.qpa.events") -+Q_LOGGING_CATEGORY(lcQpaGl, "qt.qpa.gl") -+Q_LOGGING_CATEGORY(lcQpaMime, "qt.qpa.mime") -+Q_LOGGING_CATEGORY(lcQpaInputMethods, "qt.qpa.input.methods") -+Q_LOGGING_CATEGORY(lcQpaDialogs, "qt.qpa.dialogs") -+Q_LOGGING_CATEGORY(lcQpaMenus, "qt.qpa.menus") -+Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet") -+Q_LOGGING_CATEGORY(lcQpaAccessibility, "qt.qpa.accessibility") -+Q_LOGGING_CATEGORY(lcQpaUiAutomation, "qt.qpa.uiautomation") -+Q_LOGGING_CATEGORY(lcQpaTrayIcon, "qt.qpa.trayicon") -+ -+int QWindowsContext::verbose =3D 0; -+ -+#if !defined(LANG_SYRIAC) -+# define LANG_SYRIAC 0x5a -+#endif -+ -+static inline bool useRTL_Extensions() -+{ -+ // Since the IsValidLanguageGroup/IsValidLocale functions always retu= rn true on -+ // Vista, check the Keyboard Layouts for enabling RTL. -+ if (const int nLayouts =3D GetKeyboardLayoutList(0, 0)) { -+ QScopedArrayPointer lpList(new HKL[nLayouts]); -+ GetKeyboardLayoutList(nLayouts, lpList.data()); -+ for (int i =3D 0; i < nLayouts; ++i) { -+ switch (PRIMARYLANGID((quintptr)lpList[i])) { -+ case LANG_ARABIC: -+ case LANG_HEBREW: -+ case LANG_FARSI: -+ case LANG_SYRIAC: -+ return true; -+ default: -+ break; -+ } -+ } -+ } -+ return false; -+} -+ -+#if QT_CONFIG(sessionmanager) -+static inline QWindowsSessionManager *platformSessionManager() -+{ -+ QGuiApplicationPrivate *guiPrivate =3D static_cast(QObjectPrivate::get(qApp)); -+ QSessionManagerPrivate *managerPrivate =3D static_cast(QObjectPrivate::get(guiPrivate->session_manager)); -+ return static_cast(managerPrivate->platform= SessionManager); -+} -+ -+static inline bool sessionManagerInteractionBlocked() -+{ -+ return platformSessionManager()->isInteractionBlocked(); -+} -+#else // QT_CONFIG(sessionmanager) -+static inline bool sessionManagerInteractionBlocked() { return false; } -+#endif -+ -+static inline int windowDpiAwareness(HWND hwnd) -+{ -+ return QWindowsContext::user32dll.getWindowDpiAwarenessContext && QWi= ndowsContext::user32dll.getWindowDpiAwarenessContext -+ ? QWindowsContext::user32dll.getAwarenessFromDpiAwarenessContext(= QWindowsContext::user32dll.getWindowDpiAwarenessContext(hwnd)) -+ : -1; -+} -+ -+// Note: This only works within WM_NCCREATE -+static bool enableNonClientDpiScaling(HWND hwnd) -+{ -+ bool result =3D false; -+ if (QWindowsContext::user32dll.enableNonClientDpiScaling && windowDpi= Awareness(hwnd) =3D=3D 2) { -+ result =3D QWindowsContext::user32dll.enableNonClientDpiScaling(h= wnd) !=3D FALSE; -+ if (!result) { -+ const DWORD errorCode =3D GetLastError(); -+ qErrnoWarning(int(errorCode), "EnableNonClientDpiScaling() fa= iled for HWND %p (%lu)", -+ hwnd, errorCode); -+ } -+ } -+ return result; -+} -+ -+/*! -+ \class QWindowsUser32DLL -+ \brief Struct that contains dynamically resolved symbols of User32.dl= l. -+ -+ The stub libraries shipped with the MinGW compiler miss some of the -+ functions. They need to be retrieved dynamically. -+ -+ In addition, touch-related functions are available only from Windows = onwards. -+ These need to resolved dynamically for Q_CC_MSVC as well. -+ -+ \sa QWindowsShell32DLL -+ -+ \internal -+ \ingroup qt-lighthouse-win -+*/ -+ -+void QWindowsUser32DLL::init() -+{ -+ QSystemLibrary library(QStringLiteral("user32")); -+ setProcessDPIAware =3D (SetProcessDPIAware)library.resolve("SetProces= sDPIAware"); -+ -+ addClipboardFormatListener =3D (AddClipboardFormatListener)library.re= solve("AddClipboardFormatListener"); -+ removeClipboardFormatListener =3D (RemoveClipboardFormatListener)libr= ary.resolve("RemoveClipboardFormatListener"); -+ -+ getDisplayAutoRotationPreferences =3D (GetDisplayAutoRotationPreferen= ces)library.resolve("GetDisplayAutoRotationPreferences"); -+ setDisplayAutoRotationPreferences =3D (SetDisplayAutoRotationPreferen= ces)library.resolve("SetDisplayAutoRotationPreferences"); -+ -+ if (QOperatingSystemVersion::current() -+ >=3D QOperatingSystemVersion(QOperatingSystemVersion::Windows, 10= , 0, 14393)) { -+ enableNonClientDpiScaling =3D (EnableNonClientDpiScaling)library.= resolve("EnableNonClientDpiScaling"); -+ getWindowDpiAwarenessContext =3D (GetWindowDpiAwarenessContext)li= brary.resolve("GetWindowDpiAwarenessContext"); -+ getAwarenessFromDpiAwarenessContext =3D (GetAwarenessFromDpiAware= nessContext)library.resolve("GetAwarenessFromDpiAwarenessContext"); -+ } -+} -+ -+void QWindowsShcoreDLL::init() -+{ -+ if (QOperatingSystemVersion::current() < QOperatingSystemVersion::Win= dows8_1) -+ return; -+ QSystemLibrary library(QStringLiteral("SHCore")); -+ getProcessDpiAwareness =3D (GetProcessDpiAwareness)library.resolve("G= etProcessDpiAwareness"); -+ setProcessDpiAwareness =3D (SetProcessDpiAwareness)library.resolve("S= etProcessDpiAwareness"); -+ getDpiForMonitor =3D (GetDpiForMonitor)library.resolve("GetDpiForMoni= tor"); -+} -+ -+QWindowsUser32DLL QWindowsContext::user32dll; -+QWindowsShcoreDLL QWindowsContext::shcoredll; -+ -+QWindowsContext *QWindowsContext::m_instance =3D 0; -+ -+/*! -+ \class QWindowsContext -+ \brief Singleton container for all relevant information. -+ -+ Holds state information formerly stored in \c qapplication_win.cpp. -+ -+ \internal -+ \ingroup qt-lighthouse-win -+*/ -+ -+typedef QHash HandleBaseWindowHash; -+ -+struct QWindowsContextPrivate { -+ QWindowsContextPrivate(); -+ -+ unsigned m_systemInfo =3D 0; -+ QSet m_registeredWindowClassNames; -+ HandleBaseWindowHash m_windows; -+ HDC m_displayContext =3D 0; -+ int m_defaultDPI =3D 96; -+ QWindowsKeyMapper m_keyMapper; -+ QWindowsMouseHandler m_mouseHandler; -+ QWindowsMimeConverter m_mimeConverter; -+ QWindowsScreenManager m_screenManager; -+ QSharedPointer m_creationContext; -+#if QT_CONFIG(tabletevent) -+ QScopedPointer m_tabletSupport; -+#endif -+ const HRESULT m_oleInitializeResult; -+ QWindow *m_lastActiveWindow =3D nullptr; -+ bool m_asyncExpose =3D false; -+}; -+ -+QWindowsContextPrivate::QWindowsContextPrivate() -+ : m_oleInitializeResult(OleInitialize(NULL)) -+{ -+ QWindowsContext::user32dll.init(); -+ QWindowsContext::shcoredll.init(); -+ -+ if (m_mouseHandler.touchDevice()) -+ m_systemInfo |=3D QWindowsContext::SI_SupportsTouch; -+ m_displayContext =3D GetDC(0); -+ m_defaultDPI =3D GetDeviceCaps(m_displayContext, LOGPIXELSY); -+ if (useRTL_Extensions()) { -+ m_systemInfo |=3D QWindowsContext::SI_RTL_Extensions; -+ m_keyMapper.setUseRTLExtensions(true); -+ } -+ if (FAILED(m_oleInitializeResult)) { -+ qWarning() << "QWindowsContext: OleInitialize() failed: " -+ << QWindowsContext::comErrorString(m_oleInitializeResult); -+ } -+} -+ -+QWindowsContext::QWindowsContext() : -+ d(new QWindowsContextPrivate) -+{ -+#ifdef Q_CC_MSVC -+# pragma warning( disable : 4996 ) -+#endif -+ m_instance =3D this; -+ // ### FIXME: Remove this once the logging system has other options o= f configurations. -+ const QByteArray bv =3D qgetenv("QT_QPA_VERBOSE"); -+ if (!bv.isEmpty()) -+ QLoggingCategory::setFilterRules(QString::fromLocal8Bit(bv)); -+#if QT_CONFIG(tabletevent) -+ d->m_tabletSupport.reset(QWindowsTabletSupport::create()); -+ qCDebug(lcQpaTablet) << "Tablet support: " << (d->m_tabletSupport.isN= ull() ? QStringLiteral("None") : d->m_tabletSupport->description()); -+#endif -+} -+ -+QWindowsContext::~QWindowsContext() -+{ -+#if QT_CONFIG(tabletevent) -+ d->m_tabletSupport.reset(); // Destroy internal window before unregis= tering classes. -+#endif -+ unregisterWindowClasses(); -+ if (d->m_oleInitializeResult =3D=3D S_OK || d->m_oleInitializeResult = =3D=3D S_FALSE) -+ OleUninitialize(); -+ -+ d->m_screenManager.clearScreens(); // Order: Potentially calls back t= o the windows. -+ m_instance =3D 0; -+} -+ -+bool QWindowsContext::initTouch() -+{ -+ return initTouch(QWindowsIntegration::instance()->options()); -+} -+ -+bool QWindowsContext::initTouch(unsigned integrationOptions) -+{ -+ if (d->m_systemInfo & QWindowsContext::SI_SupportsTouch) -+ return true; -+ -+ QTouchDevice *touchDevice =3D d->m_mouseHandler.ensureTouchDevice(); -+ if (!touchDevice) -+ return false; -+ -+ if (!(integrationOptions & QWindowsIntegration::DontPassOsMouseEvents= SynthesizedFromTouch)) -+ touchDevice->setCapabilities(touchDevice->capabilities() | QTouch= Device::MouseEmulation); -+ -+ QWindowSystemInterface::registerTouchDevice(touchDevice); -+ -+ d->m_systemInfo |=3D QWindowsContext::SI_SupportsTouch; -+ -+ // A touch device was plugged while the app is running. Register all = windows for touch. -+ if (QGuiApplicationPrivate::is_app_running) { -+ for (QWindowsWindow *w : qAsConst(d->m_windows)) -+ w->registerTouchWindow(); -+ } -+ -+ return true; -+} -+ -+void QWindowsContext::setTabletAbsoluteRange(int a) -+{ -+#if QT_CONFIG(tabletevent) -+ if (!d->m_tabletSupport.isNull()) -+ d->m_tabletSupport->setAbsoluteRange(a); -+#else -+ Q_UNUSED(a) -+#endif -+} -+ -+int QWindowsContext::processDpiAwareness() -+{ -+ int result; -+ if (QWindowsContext::shcoredll.getProcessDpiAwareness -+ && SUCCEEDED(QWindowsContext::shcoredll.getProcessDpiAwareness(NU= LL, &result))) { -+ return result; -+ } -+ return -1; -+} -+ -+void QWindowsContext::setProcessDpiAwareness(QtWindows::ProcessDpiAwarene= ss dpiAwareness) -+{ -+ qCDebug(lcQpaWindows) << __FUNCTION__ << dpiAwareness; -+ if (QWindowsContext::shcoredll.isValid()) { -+ const HRESULT hr =3D QWindowsContext::shcoredll.setProcessDpiAwar= eness(dpiAwareness); -+ // E_ACCESSDENIED means set externally (MSVC manifest or external= app loading Qt plugin). -+ // Silence warning in that case unless debug is enabled. -+ if (FAILED(hr) && (hr !=3D E_ACCESSDENIED || lcQpaWindows().isDeb= ugEnabled())) { -+ qWarning().noquote().nospace() << "SetProcessDpiAwareness(" -+ << dpiAwareness << ") failed: " << QWindowsContext::comEr= rorString(hr) -+ << ", using " << QWindowsContext::processDpiAwareness(); -+ } -+ } else { -+ if (dpiAwareness !=3D QtWindows::ProcessDpiUnaware && QWindowsCon= text::user32dll.setProcessDPIAware) { -+ if (!QWindowsContext::user32dll.setProcessDPIAware()) -+ qErrnoWarning("SetProcessDPIAware() failed"); -+ } -+ } -+} -+ -+QWindowsContext *QWindowsContext::instance() -+{ -+ return m_instance; -+} -+ -+unsigned QWindowsContext::systemInfo() const -+{ -+ return d->m_systemInfo; -+} -+ -+bool QWindowsContext::useRTLExtensions() const -+{ -+ return d->m_keyMapper.useRTLExtensions(); -+} -+ -+QList QWindowsContext::possibleKeys(const QKeyEvent *e) const -+{ -+ return d->m_keyMapper.possibleKeys(e); -+} -+ -+QSharedPointer QWindowsContext::setWindowCreation= Context(const QSharedPointer &ctx) -+{ -+ const QSharedPointer old =3D d->m_creationCon= text; -+ d->m_creationContext =3D ctx; -+ return old; -+} -+ -+QSharedPointer QWindowsContext::windowCreationCon= text() const -+{ -+ return d->m_creationContext; -+} -+ -+int QWindowsContext::defaultDPI() const -+{ -+ return d->m_defaultDPI; -+} -+ -+HDC QWindowsContext::displayContext() const -+{ -+ return d->m_displayContext; -+} -+ -+QWindow *QWindowsContext::keyGrabber() const -+{ -+ return d->m_keyMapper.keyGrabber(); -+} -+ -+void QWindowsContext::setKeyGrabber(QWindow *w) -+{ -+ d->m_keyMapper.setKeyGrabber(w); -+} -+ -+// Window class registering code (from qapplication_win.cpp) -+ -+QString QWindowsContext::registerWindowClass(const QWindow *w) -+{ -+ Q_ASSERT(w); -+ const Qt::WindowFlags flags =3D w->flags(); -+ const Qt::WindowFlags type =3D flags & Qt::WindowType_Mask; -+ // Determine style and icon. -+ uint style =3D CS_DBLCLKS; -+ bool icon =3D true; -+ // The following will not set CS_OWNDC for any widget window, even if= it contains a -+ // QOpenGLWidget or QQuickWidget later on. That cannot be detected at= this stage. -+ if (w->surfaceType() =3D=3D QSurface::OpenGLSurface || (flags & Qt::M= SWindowsOwnDC)) -+ style |=3D CS_OWNDC; -+ if (!(flags & Qt::NoDropShadowWindowHint) -+ && (type =3D=3D Qt::Popup || w->property("_q_windowsDropShadow").= toBool())) { -+ style |=3D CS_DROPSHADOW; -+ } -+ switch (type) { -+ case Qt::Tool: -+ case Qt::ToolTip: -+ case Qt::Popup: -+ style |=3D CS_SAVEBITS; // Save/restore background -+ icon =3D false; -+ break; -+ case Qt::Dialog: -+ if (!(flags & Qt::WindowSystemMenuHint)) -+ icon =3D false; // QTBUG-2027, dialogs without system menu. -+ break; -+ } -+ // Create a unique name for the flag combination -+ QString cname; -+ cname +=3D QLatin1String("Qt5QWindow"); -+ switch (type) { -+ case Qt::Tool: -+ cname +=3D QLatin1String("Tool"); -+ break; -+ case Qt::ToolTip: -+ cname +=3D QLatin1String("ToolTip"); -+ break; -+ case Qt::Popup: -+ cname +=3D QLatin1String("Popup"); -+ break; -+ default: -+ break; -+ } -+ if (style & CS_DROPSHADOW) -+ cname +=3D QLatin1String("DropShadow"); -+ if (style & CS_SAVEBITS) -+ cname +=3D QLatin1String("SaveBits"); -+ if (style & CS_OWNDC) -+ cname +=3D QLatin1String("OwnDC"); -+ if (icon) -+ cname +=3D QLatin1String("Icon"); -+ -+ return registerWindowClass(cname, qWindowsWndProc, style, GetSysColor= Brush(COLOR_WINDOW), icon); -+} -+ -+QString QWindowsContext::registerWindowClass(QString cname, -+ WNDPROC proc, -+ unsigned style, -+ HBRUSH brush, -+ bool icon) -+{ -+ // since multiple Qt versions can be used in one process -+ // each one has to have window class names with a unique name -+ // The first instance gets the unmodified name; if the class -+ // has already been registered by another instance of Qt then -+ // add an instance-specific ID, the address of the window proc. -+ static int classExists =3D -1; -+ -+ const HINSTANCE appInstance =3D static_cast(GetModuleHandl= e(0)); -+ if (classExists =3D=3D -1) { -+ WNDCLASS wcinfo; -+ classExists =3D GetClassInfo(appInstance, reinterpret_cast(cname.utf16()), &wcinfo); -+ classExists =3D classExists && wcinfo.lpfnWndProc !=3D proc; -+ } -+ -+ if (classExists) -+ cname +=3D QString::number(reinterpret_cast(proc)); -+ -+ if (d->m_registeredWindowClassNames.contains(cname)) // alread= y registered in our list -+ return cname; -+ -+ WNDCLASSEX wc; -+ wc.cbSize =3D sizeof(WNDCLASSEX); -+ wc.style =3D style; -+ wc.lpfnWndProc =3D proc; -+ wc.cbClsExtra =3D 0; -+ wc.cbWndExtra =3D 0; -+ wc.hInstance =3D appInstance; -+ wc.hCursor =3D 0; -+ wc.hbrBackground =3D brush; -+ if (icon) { -+ wc.hIcon =3D static_cast(LoadImage(appInstance, L"IDI_ICON= 1", IMAGE_ICON, 0, 0, LR_DEFAULTSIZE)); -+ if (wc.hIcon) { -+ int sw =3D GetSystemMetrics(SM_CXSMICON); -+ int sh =3D GetSystemMetrics(SM_CYSMICON); -+ wc.hIconSm =3D static_cast(LoadImage(appInstance, L"ID= I_ICON1", IMAGE_ICON, sw, sh, 0)); -+ } else { -+ wc.hIcon =3D static_cast(LoadImage(0, IDI_APPLICATION,= IMAGE_ICON, 0, 0, LR_DEFAULTSIZE | LR_SHARED)); -+ wc.hIconSm =3D 0; -+ } -+ } else { -+ wc.hIcon =3D 0; -+ wc.hIconSm =3D 0; -+ } -+ -+ wc.lpszMenuName =3D 0; -+ wc.lpszClassName =3D reinterpret_cast(cname.utf16()); -+ ATOM atom =3D RegisterClassEx(&wc); -+ if (!atom) -+ qErrnoWarning("QApplication::regClass: Registering window class '= %s' failed.", -+ qPrintable(cname)); -+ -+ d->m_registeredWindowClassNames.insert(cname); -+ qCDebug(lcQpaWindows).nospace() << __FUNCTION__ << ' ' << cname -+ << " style=3D0x" << hex << style << dec -+ << " brush=3D" << brush << " icon=3D" << icon << " atom=3D" << at= om; -+ return cname; -+} -+ -+void QWindowsContext::unregisterWindowClasses() -+{ -+ const HINSTANCE appInstance =3D static_cast(GetModuleHandl= e(0)); -+ -+ foreach (const QString &name, d->m_registeredWindowClassNames) { -+ if (!UnregisterClass(reinterpret_cast(name.utf16()), app= Instance) && QWindowsContext::verbose) -+ qErrnoWarning("UnregisterClass failed for '%s'", qPrintable(n= ame)); -+ } -+ d->m_registeredWindowClassNames.clear(); -+} -+ -+int QWindowsContext::screenDepth() const -+{ -+ return GetDeviceCaps(d->m_displayContext, BITSPIXEL); -+} -+ -+QString QWindowsContext::windowsErrorMessage(unsigned long errorCode) -+{ -+ QString rc =3D QString::fromLatin1("#%1: ").arg(errorCode); -+ ushort *lpMsgBuf; -+ -+ const DWORD len =3D FormatMessage( -+ FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |= FORMAT_MESSAGE_IGNORE_INSERTS, -+ NULL, errorCode, 0, reinterpret_cast(&lpMsgBuf), 0, N= ULL); -+ if (len) { -+ rc =3D QString::fromUtf16(lpMsgBuf, int(len)); -+ LocalFree(lpMsgBuf); -+ } else { -+ rc +=3D QString::fromLatin1(""); -+ } -+ return rc; -+} -+ -+void QWindowsContext::addWindow(HWND hwnd, QWindowsWindow *w) -+{ -+ d->m_windows.insert(hwnd, w); -+} -+ -+void QWindowsContext::removeWindow(HWND hwnd) -+{ -+ const HandleBaseWindowHash::iterator it =3D d->m_windows.find(hwnd); -+ if (it !=3D d->m_windows.end()) { -+ if (d->m_keyMapper.keyGrabber() =3D=3D it.value()->window()) -+ d->m_keyMapper.setKeyGrabber(0); -+ d->m_windows.erase(it); -+ } -+} -+ -+QWindowsWindow *QWindowsContext::findPlatformWindow(const QWindowsMenuBar= *mb) const -+{ -+ for (auto it =3D d->m_windows.cbegin(), end =3D d->m_windows.cend(); = it !=3D end; ++it) { -+ if ((*it)->menuBar() =3D=3D mb) -+ return *it; -+ } -+ return nullptr; -+} -+ -+QWindowsWindow *QWindowsContext::findPlatformWindow(HWND hwnd) const -+{ -+ return d->m_windows.value(hwnd); -+} -+ -+QWindowsWindow *QWindowsContext::findClosestPlatformWindow(HWND hwnd) con= st -+{ -+ QWindowsWindow *window =3D d->m_windows.value(hwnd); -+ -+ // Requested hwnd may also be a child of a platform window in case of= embedded native windows. -+ // Find the closest parent that has a platform window. -+ if (!window) { -+ for (HWND w =3D hwnd; w; w =3D GetParent(w)) { -+ window =3D d->m_windows.value(w); -+ if (window) -+ break; -+ } -+ } -+ -+ return window; -+} -+ -+QWindow *QWindowsContext::findWindow(HWND hwnd) const -+{ -+ if (const QWindowsWindow *bw =3D findPlatformWindow(hwnd)) -+ return bw->window(); -+ return 0; -+} -+ -+QWindow *QWindowsContext::windowUnderMouse() const -+{ -+ return d->m_mouseHandler.windowUnderMouse(); -+} -+ -+void QWindowsContext::clearWindowUnderMouse() -+{ -+ d->m_mouseHandler.clearWindowUnderMouse(); -+} -+ -+/*! -+ \brief Find a child window at a screen point. -+ -+ Deep search for a QWindow at global point, skipping non-owned -+ windows (accessibility?). Implemented using ChildWindowFromPointEx() -+ instead of (historically used) WindowFromPoint() to get a well-defined -+ behaviour for hidden/transparent windows. -+ -+ \a cwex_flags are flags of ChildWindowFromPointEx(). -+ \a parent is the parent window, pass GetDesktopWindow() for top level= s. -+*/ -+ -+static inline bool findPlatformWindowHelper(const POINT &screenPoint, uns= igned cwexFlags, -+ const QWindowsContext *contex= t, -+ HWND *hwnd, QWindowsWindow **= result) -+{ -+ POINT point =3D screenPoint; -+ ScreenToClient(*hwnd, &point); -+ // Returns parent if inside & none matched. -+ const HWND child =3D ChildWindowFromPointEx(*hwnd, point, cwexFlags); -+ if (!child || child =3D=3D *hwnd) -+ return false; -+ if (QWindowsWindow *window =3D context->findPlatformWindow(child)) { -+ *result =3D window; -+ *hwnd =3D child; -+ return true; -+ } -+ // QTBUG-40555: despite CWP_SKIPINVISIBLE, it is possible to hit on i= nvisible -+ // full screen windows of other applications that have WS_EX_TRANSPAR= ENT set -+ // (for example created by screen sharing applications). In that cas= e, try to -+ // find a Qt window by searching again with CWP_SKIPTRANSPARENT. -+ // Note that Qt 5 uses WS_EX_TRANSPARENT for Qt::WindowTransparentFor= Input -+ // as well. -+ if (!(cwexFlags & CWP_SKIPTRANSPARENT) -+ && (GetWindowLongPtr(child, GWL_EXSTYLE) & WS_EX_TRANSPARENT)) { -+ const HWND nonTransparentChild =3D ChildWindowFromPointEx(*hwnd, = point, cwexFlags | CWP_SKIPTRANSPARENT); -+ if (QWindowsWindow *nonTransparentWindow =3D context->findPlatfor= mWindow(nonTransparentChild)) { -+ *result =3D nonTransparentWindow; -+ *hwnd =3D nonTransparentChild; -+ return true; -+ } -+ } -+ *hwnd =3D child; -+ return true; -+} -+ -+QWindowsWindow *QWindowsContext::findPlatformWindowAt(HWND parent, -+ const QPoint &s= creenPointIn, -+ unsigned cwex_f= lags) const -+{ -+ QWindowsWindow *result =3D 0; -+ const POINT screenPoint =3D { screenPointIn.x(), screenPointIn.y() }; -+ while (findPlatformWindowHelper(screenPoint, cwex_flags, this, &paren= t, &result)) {} -+ return result; -+} -+ -+QWindowsMimeConverter &QWindowsContext::mimeConverter() const -+{ -+ return d->m_mimeConverter; -+} -+ -+QWindowsScreenManager &QWindowsContext::screenManager() -+{ -+ return d->m_screenManager; -+} -+ -+QWindowsTabletSupport *QWindowsContext::tabletSupport() const -+{ -+#if QT_CONFIG(tabletevent) -+ return d->m_tabletSupport.data(); -+#else -+ return 0; -+#endif -+} -+ -+/*! -+ \brief Convenience to create a non-visible, message-only dummy -+ window for example used as clipboard watcher or for GL. -+*/ -+ -+HWND QWindowsContext::createDummyWindow(const QString &classNameIn, -+ const wchar_t *windowName, -+ WNDPROC wndProc, DWORD style) -+{ -+ if (!wndProc) -+ wndProc =3D DefWindowProc; -+ QString className =3D registerWindowClass(classNameIn, wndProc); -+ return CreateWindowEx(0, reinterpret_cast(className.utf16()), -+ windowName, style, -+ CW_USEDEFAULT, CW_USEDEFAULT, -+ CW_USEDEFAULT, CW_USEDEFAULT, -+ HWND_MESSAGE, NULL, static_cast(GetM= oduleHandle(0)), NULL); -+} -+ -+// Re-engineered from the inline function _com_error::ErrorMessage(). -+// We cannot use it directly since it uses swprintf_s(), which is not -+// present in the MSVCRT.DLL found on Windows XP (QTBUG-35617). -+static inline QString errorMessageFromComError(const _com_error &comError) -+{ -+ TCHAR *message =3D nullptr; -+ FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_S= YSTEM, -+ NULL, DWORD(comError.Error()), MAKELANGID(LANG_NEUTRAL= ,SUBLANG_DEFAULT), -+ message, 0, NULL); -+ if (message) { -+ const QString result =3D QString::fromWCharArray(message).trimme= d(); -+ LocalFree(static_cast(message)); -+ return result; -+ } -+ if (const WORD wCode =3D comError.WCode()) -+ return QString::asprintf("IDispatch error #%u", uint(wCode)); -+ return QString::asprintf("Unknown error 0x0%x", uint(comError.Error(= ))); -+} -+ -+/*! -+ \brief Common COM error strings. -+*/ -+ -+QByteArray QWindowsContext::comErrorString(HRESULT hr) -+{ -+ QByteArray result =3D QByteArrayLiteral("COM error 0x") -+ + QByteArray::number(quintptr(hr), 16) + ' '; -+ switch (hr) { -+ case S_OK: -+ result +=3D QByteArrayLiteral("S_OK"); -+ break; -+ case S_FALSE: -+ result +=3D QByteArrayLiteral("S_FALSE"); -+ break; -+ case E_UNEXPECTED: -+ result +=3D QByteArrayLiteral("E_UNEXPECTED"); -+ break; -+ case E_ACCESSDENIED: -+ result +=3D QByteArrayLiteral("E_ACCESSDENIED"); -+ break; -+ case CO_E_ALREADYINITIALIZED: -+ result +=3D QByteArrayLiteral("CO_E_ALREADYINITIALIZED"); -+ break; -+ case CO_E_NOTINITIALIZED: -+ result +=3D QByteArrayLiteral("CO_E_NOTINITIALIZED"); -+ break; -+ case RPC_E_CHANGED_MODE: -+ result +=3D QByteArrayLiteral("RPC_E_CHANGED_MODE"); -+ break; -+ case OLE_E_WRONGCOMPOBJ: -+ result +=3D QByteArrayLiteral("OLE_E_WRONGCOMPOBJ"); -+ break; -+ case CO_E_NOT_SUPPORTED: -+ result +=3D QByteArrayLiteral("CO_E_NOT_SUPPORTED"); -+ break; -+ case E_NOTIMPL: -+ result +=3D QByteArrayLiteral("E_NOTIMPL"); -+ break; -+ case E_INVALIDARG: -+ result +=3D QByteArrayLiteral("E_INVALIDARG"); -+ break; -+ case E_NOINTERFACE: -+ result +=3D QByteArrayLiteral("E_NOINTERFACE"); -+ break; -+ case E_POINTER: -+ result +=3D QByteArrayLiteral("E_POINTER"); -+ break; -+ case E_HANDLE: -+ result +=3D QByteArrayLiteral("E_HANDLE"); -+ break; -+ case E_ABORT: -+ result +=3D QByteArrayLiteral("E_ABORT"); -+ break; -+ case E_FAIL: -+ result +=3D QByteArrayLiteral("E_FAIL"); -+ break; -+ case RPC_E_WRONG_THREAD: -+ result +=3D QByteArrayLiteral("RPC_E_WRONG_THREAD"); -+ break; -+ case RPC_E_THREAD_NOT_INIT: -+ result +=3D QByteArrayLiteral("RPC_E_THREAD_NOT_INIT"); -+ break; -+ default: -+ break; -+ } -+ _com_error error(hr); -+ result +=3D QByteArrayLiteral(" ("); -+ result +=3D errorMessageFromComError(error); -+ result +=3D ')'; -+ return result; -+} -+ -+static inline QWindowsInputContext *windowsInputContext() -+{ -+ return qobject_cast(QWindowsIntegration::inst= ance()->inputContext()); -+} -+ -+ -+// Child windows, fixed-size windows or pop-ups and similar should not be= resized -+static inline bool resizeOnDpiChanged(const QWindow *w) -+{ -+ bool result =3D false; -+ if (w->isTopLevel()) { -+ switch (w->type()) { -+ case Qt::Window: -+ case Qt::Dialog: -+ case Qt::Sheet: -+ case Qt::Drawer: -+ case Qt::Tool: -+ result =3D !w->flags().testFlag(Qt::MSWindowsFixedSizeDialogH= int); -+ break; -+ default: -+ break; -+ } -+ } -+ return result; -+} -+ -+static bool shouldHaveNonClientDpiScaling(const QWindow *window) -+{ -+ return QOperatingSystemVersion::current() >=3D QOperatingSystemVersio= n::Windows10 -+ && window->isTopLevel() -+ && !window->property(QWindowsWindow::embeddedNativeParentHandlePr= operty).isValid() -+#if QT_CONFIG(opengl) // /QTBUG-62901, EnableNonClientDpiScaling has prob= lems with GL -+ && (window->surfaceType() !=3D QSurface::OpenGLSurface -+ || QOpenGLContext::openGLModuleType() !=3D QOpenGLContext::Li= bGL) -+#endif -+ ; -+} -+ -+static inline bool isInputMessage(UINT m) -+{ -+ switch (m) { -+ case WM_IME_STARTCOMPOSITION: -+ case WM_IME_ENDCOMPOSITION: -+ case WM_IME_COMPOSITION: -+ case WM_TOUCH: -+ case WM_MOUSEHOVER: -+ case WM_MOUSELEAVE: -+ case WM_NCHITTEST: -+ case WM_NCMOUSEHOVER: -+ case WM_NCMOUSELEAVE: -+ case WM_SIZING: -+ case WM_MOVING: -+ case WM_SYSCOMMAND: -+ case WM_COMMAND: -+ case WM_DWMNCRENDERINGCHANGED: -+ case WM_PAINT: -+ return true; -+ default: -+ break; -+ } -+ return (m >=3D WM_MOUSEFIRST && m <=3D WM_MOUSELAST) -+ || (m >=3D WM_NCMOUSEMOVE && m <=3D WM_NCXBUTTONDBLCLK) -+ || (m >=3D WM_KEYFIRST && m <=3D WM_KEYLAST); -+} -+ -+/*! -+ \brief Main windows procedure registered for windows. -+ -+ \sa QWindowsGuiEventDispatcher -+*/ -+ -+bool QWindowsContext::windowsProc(HWND hwnd, UINT message, -+ QtWindows::WindowsEventType et, -+ WPARAM wParam, LPARAM lParam, -+ LRESULT *result, -+ QWindowsWindow **platformWindowPtr) -+{ -+ *result =3D 0; -+ -+ MSG msg; -+ msg.hwnd =3D hwnd; // re-create MSG structure -+ msg.message =3D message; // time and pt fields ignored -+ msg.wParam =3D wParam; -+ msg.lParam =3D lParam; -+ msg.pt.x =3D msg.pt.y =3D 0; -+ if (et !=3D QtWindows::CursorEvent && (et & (QtWindows::MouseEventFla= g | QtWindows::NonClientEventFlag))) { -+ msg.pt.x =3D GET_X_LPARAM(lParam); -+ msg.pt.y =3D GET_Y_LPARAM(lParam); -+ // For non-client-area messages, these are screen coordinates (as= expected -+ // in the MSG structure), otherwise they are client coordinates. -+ if (!(et & QtWindows::NonClientEventFlag)) { -+ ClientToScreen(msg.hwnd, &msg.pt); -+ } -+ } else { -+ GetCursorPos(&msg.pt); -+ } -+ -+ QWindowsWindow *platformWindow =3D findPlatformWindow(hwnd); -+ *platformWindowPtr =3D platformWindow; -+ -+ // Run the native event filters. QTBUG-67095: Exclude input messages = which are sent -+ // by QEventDispatcherWin32::processEvents() -+ if (!isInputMessage(msg.message) && filterNativeEvent(&msg, result)) -+ return true; -+ -+ if (platformWindow && filterNativeEvent(platformWindow->window(), &ms= g, result)) -+ return true; -+ -+ if (et & QtWindows::InputMethodEventFlag) { -+ QWindowsInputContext *windowsInputContext =3D ::windowsInputConte= xt(); -+ // Disable IME assuming this is a special implementation hooking = into keyboard input. -+ // "Real" IME implementations should use a native event filter in= tercepting IME events. -+ if (!windowsInputContext) { -+ QWindowsInputContext::setWindowsImeEnabled(platformWindow, fa= lse); -+ return false; -+ } -+ switch (et) { -+ case QtWindows::InputMethodStartCompositionEvent: -+ return windowsInputContext->startComposition(hwnd); -+ case QtWindows::InputMethodCompositionEvent: -+ return windowsInputContext->composition(hwnd, lParam); -+ case QtWindows::InputMethodEndCompositionEvent: -+ return windowsInputContext->endComposition(hwnd); -+ case QtWindows::InputMethodRequest: -+ return windowsInputContext->handleIME_Request(wParam, lParam,= result); -+ default: -+ break; -+ } -+ } // InputMethodEventFlag -+ -+ switch (et) { -+ case QtWindows::GestureEvent: -+ return sessionManagerInteractionBlocked() || d->m_mouseHandler.tr= anslateGestureEvent(platformWindow->window(), hwnd, et, msg, result); -+ case QtWindows::InputMethodOpenCandidateWindowEvent: -+ case QtWindows::InputMethodCloseCandidateWindowEvent: -+ // TODO: Release/regrab mouse if a popup has mouse grab. -+ return false; -+ case QtWindows::DestroyEvent: -+ if (platformWindow && !platformWindow->testFlag(QWindowsWindow::W= ithinDestroy)) { -+ qWarning() << "External WM_DESTROY received for " << platform= Window->window() -+ << ", parent: " << platformWindow->window()->paren= t() -+ << ", transient parent: " << platformWindow->windo= w()->transientParent(); -+ } -+ return false; -+ case QtWindows::ClipboardEvent: -+ return false; -+ case QtWindows::UnknownEvent: -+ return false; -+ case QtWindows::AccessibleObjectFromWindowRequest: -+#ifndef QT_NO_ACCESSIBILITY -+ return QWindowsUiaAccessibility::handleWmGetObject(hwnd, wParam, = lParam, result); -+#else -+ return false; -+#endif -+ case QtWindows::DisplayChangedEvent: -+ if (QWindowsTheme *t =3D QWindowsTheme::instance()) -+ t->displayChanged(); -+ return d->m_screenManager.handleDisplayChange(wParam, lParam); -+ case QtWindows::SettingChangedEvent: -+ return d->m_screenManager.handleScreenChanges(); -+ default: -+ break; -+ } -+ -+ // Before CreateWindowEx() returns, some events are sent, -+ // for example WM_GETMINMAXINFO asking for size constraints for top l= evels. -+ // Pass on to current creation context -+ if (!platformWindow && !d->m_creationContext.isNull()) { -+ switch (et) { -+ case QtWindows::QuerySizeHints: -+ d->m_creationContext->applyToMinMaxInfo(reinterpret_cast(lParam)); -+ return true; -+ case QtWindows::ResizeEvent: { -+ const QSize size(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) -= d->m_creationContext->menuHeight); -+ d->m_creationContext->obtainedGeometry.setSize(size); -+ } -+ return true; -+ case QtWindows::MoveEvent: -+ d->m_creationContext->obtainedGeometry.moveTo(GET_X_LPARAM(lP= aram), GET_Y_LPARAM(lParam)); -+ return true; -+ case QtWindows::NonClientCreate: -+ if (shouldHaveNonClientDpiScaling(d->m_creationContext->windo= w)) -+ enableNonClientDpiScaling(msg.hwnd); -+ return false; -+ case QtWindows::CalculateSize: -+ return QWindowsGeometryHint::handleCalculateSize(d->m_creatio= nContext->customMargins, msg, result); -+ case QtWindows::GeometryChangingEvent: -+ return QWindowsWindow::handleGeometryChangingMessage(&msg, d-= >m_creationContext->window, -+ d->m_cre= ationContext->margins + d->m_creationContext->customMargins); -+ default: -+ break; -+ } -+ } -+ if (platformWindow) { -+ // Suppress events sent during DestroyWindow() for native childre= n. -+ if (platformWindow->testFlag(QWindowsWindow::WithinDestroy)) -+ return false; -+ if (QWindowsContext::verbose > 1) -+ qCDebug(lcQpaEvents) << "Event window: " << platformWindow->w= indow(); -+ } else { -+ qWarning("%s: No Qt Window found for event 0x%x (%s), hwnd=3D0x%p= .", -+ __FUNCTION__, message, -+ QWindowsGuiEventDispatcher::windowsMessageName(message),= hwnd); -+ return false; -+ } -+ -+ switch (et) { -+ case QtWindows::DeviceChangeEvent: -+ if (d->m_systemInfo & QWindowsContext::SI_SupportsTouch) -+ break; -+ // See if there are any touch devices added -+ if (wParam =3D=3D DBT_DEVNODES_CHANGED) -+ initTouch(); -+ break; -+ case QtWindows::KeyboardLayoutChangeEvent: -+ if (QWindowsInputContext *wic =3D windowsInputContext()) -+ wic->handleInputLanguageChanged(wParam, lParam); -+ Q_FALLTHROUGH(); -+ case QtWindows::KeyDownEvent: -+ case QtWindows::KeyEvent: -+ case QtWindows::InputMethodKeyEvent: -+ case QtWindows::InputMethodKeyDownEvent: -+ case QtWindows::AppCommandEvent: -+ return sessionManagerInteractionBlocked() || d->m_keyMapper.tran= slateKeyEvent(platformWindow->window(), hwnd, msg, result); -+ case QtWindows::MenuAboutToShowEvent: -+ if (sessionManagerInteractionBlocked()) -+ return true; -+ if (QWindowsPopupMenu::notifyAboutToShow(reinterpret_cast(= wParam))) -+ return true; -+ if (platformWindow =3D=3D nullptr || platformWindow->menuBar() = =3D=3D nullptr) -+ return false; -+ return platformWindow->menuBar()->notifyAboutToShow(reinterpret_c= ast(wParam)); -+ case QtWindows::MenuCommandEvent: -+ if (sessionManagerInteractionBlocked()) -+ return true; -+ if (QWindowsPopupMenu::notifyTriggered(LOWORD(wParam))) -+ return true; -+ if (platformWindow =3D=3D nullptr || platformWindow->menuBar() = =3D=3D nullptr) -+ return false; -+ return platformWindow->menuBar()->notifyTriggered(LOWORD(wParam)); -+ case QtWindows::MoveEvent: -+ platformWindow->handleMoved(); -+ return true; -+ case QtWindows::ResizeEvent: -+ platformWindow->handleResized(static_cast(wParam)); -+ return true; -+ case QtWindows::QuerySizeHints: -+ platformWindow->getSizeHints(reinterpret_cast(lPara= m)); -+ return true;// maybe available on some SDKs revisit WM_NCCALCSIZE -+ case QtWindows::CalculateSize: -+ return QWindowsGeometryHint::handleCalculateSize(platformWindow->= customMargins(), msg, result); -+ case QtWindows::NonClientHitTest: -+ return platformWindow->handleNonClientHitTest(QPoint(msg.pt.x, ms= g.pt.y), result); -+ case QtWindows::GeometryChangingEvent: -+ return platformWindow->QWindowsWindow::handleGeometryChanging(&ms= g); -+ case QtWindows::ExposeEvent: -+ return platformWindow->handleWmPaint(hwnd, message, wParam, lPara= m); -+ case QtWindows::NonClientMouseEvent: -+ if (platformWindow->frameStrutEventsEnabled()) -+ return sessionManagerInteractionBlocked() || d->m_mouseHandle= r.translateMouseEvent(platformWindow->window(), hwnd, et, msg, result); -+ break; -+ case QtWindows::EnterSizeMoveEvent: -+ platformWindow->setFlag(QWindowsWindow::ResizeMoveActive); -+ return true; -+ case QtWindows::ExitSizeMoveEvent: -+ platformWindow->clearFlag(QWindowsWindow::ResizeMoveActive); -+ platformWindow->checkForScreenChanged(); -+ return true; -+ case QtWindows::ScrollEvent: -+ return sessionManagerInteractionBlocked() || d->m_mouseHandler.tr= anslateScrollEvent(platformWindow->window(), hwnd, msg, result); -+ case QtWindows::MouseWheelEvent: -+ case QtWindows::MouseEvent: -+ case QtWindows::LeaveEvent: -+ { -+ QWindow *window =3D platformWindow->window(); -+ while (window && (window->flags() & Qt::WindowTransparentForI= nput)) -+ window =3D window->parent(); -+ if (!window) -+ return false; -+ return sessionManagerInteractionBlocked() || d->m_mouseHandle= r.translateMouseEvent(window, hwnd, et, msg, result); -+ } -+ case QtWindows::TouchEvent: -+ return sessionManagerInteractionBlocked() || d->m_mouseHandler.tr= anslateTouchEvent(platformWindow->window(), hwnd, et, msg, result); -+ case QtWindows::FocusInEvent: // see QWindowsWindow::requestActivateW= indow(). -+ case QtWindows::FocusOutEvent: -+ handleFocusEvent(et, platformWindow); -+ return true; -+ case QtWindows::ShowEventOnParentRestoring: // QTBUG-40696, prevent W= indows from re-showing hidden transient children (dialogs). -+ if (!platformWindow->window()->isVisible()) { -+ *result =3D 0; -+ return true; -+ } -+ break; -+ case QtWindows::HideEvent: -+ platformWindow->handleHidden(); -+ return false;// Indicate transient children should be hidden by w= indows (SW_PARENTCLOSING) -+ case QtWindows::CloseEvent: -+ QWindowSystemInterface::handleCloseEvent(platformWindow->window()= ); -+ return true; -+ case QtWindows::ThemeChanged: { -+ // Switch from Aero to Classic changes margins. -+ if (QWindowsTheme *theme =3D QWindowsTheme::instance()) -+ theme->windowsThemeChanged(platformWindow->window()); -+ return true; -+ } -+ case QtWindows::CompositionSettingsChanged: -+ platformWindow->handleCompositionSettingsChanged(); -+ return true; -+ case QtWindows::ActivateWindowEvent: -+ if (platformWindow->window()->flags() & Qt::WindowDoesNotAcceptFo= cus) { -+ *result =3D LRESULT(MA_NOACTIVATE); -+ return true; -+ } -+#if QT_CONFIG(tabletevent) -+ if (!d->m_tabletSupport.isNull()) -+ d->m_tabletSupport->notifyActivate(); -+#endif // QT_CONFIG(tabletevent) -+ if (platformWindow->testFlag(QWindowsWindow::BlockedByModal)) -+ if (const QWindow *modalWindow =3D QGuiApplication::modalWind= ow()) { -+ QWindowsWindow *platformWindow =3D QWindowsWindow::window= sWindowOf(modalWindow); -+ Q_ASSERT(platformWindow); -+ platformWindow->alertWindow(); -+ } -+ break; -+ case QtWindows::MouseActivateWindowEvent: -+ if (platformWindow->window()->flags() & Qt::WindowDoesNotAcceptFo= cus) { -+ *result =3D LRESULT(MA_NOACTIVATE); -+ return true; -+ } -+ break; -+#ifndef QT_NO_CONTEXTMENU -+ case QtWindows::ContextMenu: -+ return handleContextMenuEvent(platformWindow->window(), msg); -+#endif -+ case QtWindows::WhatsThisEvent: { -+#ifndef QT_NO_WHATSTHIS -+ QWindowSystemInterface::handleEnterWhatsThisEvent(); -+ return true; -+#endif -+ } break; -+ case QtWindows::DpiChangedEvent: { -+ if (!resizeOnDpiChanged(platformWindow->window())) -+ return false; -+ platformWindow->setFlag(QWindowsWindow::WithinDpiChanged); -+ const RECT *prcNewWindow =3D reinterpret_cast(lParam); -+ SetWindowPos(hwnd, NULL, prcNewWindow->left, prcNewWindow->top, -+ prcNewWindow->right - prcNewWindow->left, -+ prcNewWindow->bottom - prcNewWindow->top, SWP_NOZORD= ER | SWP_NOACTIVATE); -+ platformWindow->clearFlag(QWindowsWindow::WithinDpiChanged); -+ return true; -+ } -+#if QT_CONFIG(sessionmanager) -+ case QtWindows::QueryEndSessionApplicationEvent: { -+ QWindowsSessionManager *sessionManager =3D platformSessionManager= (); -+ if (sessionManager->isActive()) { // bogus message from windows -+ *result =3D sessionManager->wasCanceled() ? 0 : 1; -+ return true; -+ } -+ -+ sessionManager->setActive(true); -+ sessionManager->blocksInteraction(); -+ sessionManager->clearCancellation(); -+ -+ QGuiApplicationPrivate *qGuiAppPriv =3D static_cast(QObjectPrivate::get(qApp)); -+ qGuiAppPriv->commitData(); -+ -+ if (lParam & ENDSESSION_LOGOFF) -+ fflush(NULL); -+ -+ *result =3D sessionManager->wasCanceled() ? 0 : 1; -+ return true; -+ } -+ case QtWindows::EndSessionApplicationEvent: { -+ QWindowsSessionManager *sessionManager =3D platformSessionManager= (); -+ -+ sessionManager->setActive(false); -+ sessionManager->allowsInteraction(); -+ const bool endsession =3D wParam !=3D 0; -+ -+ // we receive the message for each toplevel window included inter= nal hidden ones, -+ // but the aboutToQuit signal should be emitted only once. -+ QGuiApplicationPrivate *qGuiAppPriv =3D static_cast(QObjectPrivate::get(qApp)); -+ if (endsession && !qGuiAppPriv->aboutToQuitEmitted) { -+ qGuiAppPriv->aboutToQuitEmitted =3D true; -+ int index =3D QGuiApplication::staticMetaObject.indexOfSignal= ("aboutToQuit()"); -+ qApp->qt_metacall(QMetaObject::InvokeMetaMethod, index,0); -+ // since the process will be killed immediately quit() has no= real effect -+ QGuiApplication::quit(); -+ } -+ return true; -+ } -+#endif // !defined(QT_NO_SESSIONMANAGER) -+ default: -+ break; -+ } -+ return false; -+} -+ -+/* Compress activation events. If the next focus window is already known -+ * at the time the current one receives focus-out, pass that to -+ * QWindowSystemInterface instead of sending 0 and ignore its consecutive -+ * focus-in event. -+ * This helps applications that do handling in focus-out events. */ -+void QWindowsContext::handleFocusEvent(QtWindows::WindowsEventType et, -+ QWindowsWindow *platformWindow) -+{ -+ QWindow *nextActiveWindow =3D 0; -+ if (et =3D=3D QtWindows::FocusInEvent) { -+ QWindow *topWindow =3D QWindowsWindow::topLevelOf(platformWindow-= >window()); -+ QWindow *modalWindow =3D 0; -+ if (QGuiApplicationPrivate::instance()->isWindowBlocked(topWindow= , &modalWindow) && topWindow !=3D modalWindow) { -+ modalWindow->requestActivate(); -+ return; -+ } -+ // QTBUG-32867: Invoking WinAPI SetParent() can cause focus-in fo= r the -+ // window which is not desired for native child widgets. -+ if (platformWindow->testFlag(QWindowsWindow::WithinSetParent)) { -+ QWindow *currentFocusWindow =3D QGuiApplication::focusWindow(= ); -+ if (currentFocusWindow && currentFocusWindow !=3D platformWin= dow->window()) { -+ currentFocusWindow->requestActivate(); -+ return; -+ } -+ } -+ nextActiveWindow =3D platformWindow->window(); -+ } else { -+ // Focus out: Is the next window known and different -+ // from the receiving the focus out. -+ if (const HWND nextActiveHwnd =3D GetFocus()) -+ if (QWindowsWindow *nextActivePlatformWindow =3D findClosestP= latformWindow(nextActiveHwnd)) -+ if (nextActivePlatformWindow !=3D platformWindow) -+ nextActiveWindow =3D nextActivePlatformWindow->window= (); -+ } -+ if (nextActiveWindow !=3D d->m_lastActiveWindow) { -+ d->m_lastActiveWindow =3D nextActiveWindow; -+ QWindowSystemInterface::handleWindowActivated(nextActiveWindow); -+ } -+} -+ -+#ifndef QT_NO_CONTEXTMENU -+bool QWindowsContext::handleContextMenuEvent(QWindow *window, const MSG &= msg) -+{ -+ bool mouseTriggered =3D false; -+ QPoint globalPos; -+ QPoint pos; -+ if (msg.lParam !=3D int(0xffffffff)) { -+ mouseTriggered =3D true; -+ globalPos.setX(msg.pt.x); -+ globalPos.setY(msg.pt.y); -+ pos =3D QWindowsGeometryHint::mapFromGlobal(msg.hwnd, globalPos); -+ -+ RECT clientRect; -+ if (GetClientRect(msg.hwnd, &clientRect)) { -+ if (pos.x() < clientRect.left || pos.x() >=3D clientRect.righ= t || -+ pos.y() < clientRect.top || pos.y() >=3D clientRect.botto= m) -+ { -+ // This is the case that user has right clicked in the wi= ndow's caption, -+ // We should call DefWindowProc() to display a default sh= ortcut menu -+ // instead of sending a Qt window system event. -+ return false; -+ } -+ } -+ } -+ -+ QWindowSystemInterface::handleContextMenuEvent(window, mouseTriggered= , pos, globalPos, -+ QWindowsKeyMapper::que= ryKeyboardModifiers()); -+ return true; -+} -+#endif -+ -+bool QWindowsContext::asyncExpose() const -+{ -+ return d->m_asyncExpose; -+} -+ -+void QWindowsContext::setAsyncExpose(bool value) -+{ -+ d->m_asyncExpose =3D value; -+} -+ -+QTouchDevice *QWindowsContext::touchDevice() const -+{ -+ return d->m_mouseHandler.touchDevice(); -+} -+ -+static DWORD readDwordRegistrySetting(const wchar_t *regKey, const wchar_= t *subKey, DWORD defaultValue) -+{ -+ DWORD result =3D defaultValue; -+ HKEY handle; -+ if (RegOpenKeyEx(HKEY_CURRENT_USER, regKey, 0, KEY_READ, &handle) =3D= =3D ERROR_SUCCESS) { -+ DWORD type; -+ if (RegQueryValueEx(handle, subKey, 0, &type, 0, 0) =3D=3D ERROR_= SUCCESS && type =3D=3D REG_DWORD) { -+ DWORD value; -+ DWORD size =3D sizeof(result); -+ if (RegQueryValueEx(handle, subKey, 0, 0, reinterpret_cast(&value), &size) =3D=3D ERROR_SUCCESS) -+ result =3D value; -+ } -+ RegCloseKey(handle); -+ } -+ return result; -+} -+ -+DWORD QWindowsContext::readAdvancedExplorerSettings(const wchar_t *subKey= , DWORD defaultValue) -+{ -+ return readDwordRegistrySetting(L"Software\\Microsoft\\Windows\\Curre= ntVersion\\Explorer\\Advanced", -+ subKey, defaultValue); -+} -+ -+static inline bool isEmptyRect(const RECT &rect) -+{ -+ return rect.right - rect.left =3D=3D 0 && rect.bottom - rect.top =3D= =3D 0; -+} -+ -+static inline QMargins marginsFromRects(const RECT &frame, const RECT &cl= ient) -+{ -+ return QMargins(client.left - frame.left, client.top - frame.top, -+ frame.right - client.right, frame.bottom - client.bot= tom); -+} -+ -+static RECT rectFromNcCalcSize(UINT message, WPARAM wParam, LPARAM lParam= , int n) -+{ -+ RECT result =3D {0, 0, 0, 0}; -+ if (message =3D=3D WM_NCCALCSIZE && wParam) -+ result =3D reinterpret_cast(lParam)->r= grc[n]; -+ return result; -+} -+ -+static inline bool isMinimized(HWND hwnd) -+{ -+ WINDOWPLACEMENT windowPlacement; -+ windowPlacement.length =3D sizeof(WINDOWPLACEMENT); -+ return GetWindowPlacement(hwnd, &windowPlacement) && windowPlacement.= showCmd =3D=3D SW_SHOWMINIMIZED; -+} -+ -+static inline bool isTopLevel(HWND hwnd) -+{ -+ return (GetWindowLongPtr(hwnd, GWL_STYLE) & WS_CHILD) =3D=3D 0; -+} -+ -+/*! -+ \brief Windows functions for actual windows. -+ -+ There is another one for timers, sockets, etc in -+ QEventDispatcherWin32. -+ -+ \ingroup qt-lighthouse-win -+*/ -+ -+extern "C" LRESULT QT_WIN_CALLBACK qWindowsWndProc(HWND hwnd, UINT messag= e, WPARAM wParam, LPARAM lParam) -+{ -+ LRESULT result; -+ const QtWindows::WindowsEventType et =3D windowsEventType(message, wP= aram, lParam); -+ QWindowsWindow *platformWindow =3D nullptr; -+ const RECT ncCalcSizeFrame =3D rectFromNcCalcSize(message, wParam, lP= aram, 0); -+ const bool handled =3D QWindowsContext::instance()->windowsProc(hwnd,= message, et, wParam, lParam, &result, &platformWindow); -+ if (QWindowsContext::verbose > 1 && lcQpaEvents().isDebugEnabled()) { -+ if (const char *eventName =3D QWindowsGuiEventDispatcher::windows= MessageName(message)) { -+ qCDebug(lcQpaEvents).nospace() << "EVENT: hwd=3D" << hwnd << = ' ' << eventName -+ << " msg=3D0x" << hex << message << " et=3D0x" << et << d= ec << " wp=3D" -+ << int(wParam) << " at " << GET_X_LPARAM(lParam) << ',' -+ << GET_Y_LPARAM(lParam) << " handled=3D" << handled; -+ } -+ } -+ if (!handled) -+ result =3D DefWindowProc(hwnd, message, wParam, lParam); -+ -+ // Capture WM_NCCALCSIZE on top level windows and obtain the window m= argins by -+ // subtracting the rectangles before and after processing. This will = correctly -+ // capture client code overriding the message and allow for per-monit= or margins -+ // for High DPI (QTBUG-53255, QTBUG-40578). -+ if (message =3D=3D WM_NCCALCSIZE && !isEmptyRect(ncCalcSizeFrame) && = isTopLevel(hwnd) && !isMinimized(hwnd)) { -+ const QMargins margins =3D -+ marginsFromRects(ncCalcSizeFrame, rectFromNcCalcSize(message,= wParam, lParam, 0)); -+ if (margins.left() >=3D 0) { -+ if (platformWindow) { -+ platformWindow->setFrameMargins(margins); -+ } else { -+ const QSharedPointer ctx =3D QWin= dowsContext::instance()->windowCreationContext(); -+ if (!ctx.isNull()) -+ ctx->margins =3D margins; -+ } -+ } -+ } -+ return result; -+} -+ -+ -+static inline QByteArray nativeEventType() { return QByteArrayLiteral("wi= ndows_generic_MSG"); } -+ -+// Send to QAbstractEventDispatcher -+bool QWindowsContext::filterNativeEvent(MSG *msg, LRESULT *result) -+{ -+ QAbstractEventDispatcher *dispatcher =3D QAbstractEventDispatcher::in= stance(); -+ long filterResult =3D 0; -+ if (dispatcher && dispatcher->filterNativeEvent(nativeEventType(), ms= g, &filterResult)) { -+ *result =3D LRESULT(filterResult); -+ return true; -+ } -+ return false; -+} -+ -+// Send to QWindowSystemInterface -+bool QWindowsContext::filterNativeEvent(QWindow *window, MSG *msg, LRESUL= T *result) -+{ -+ long filterResult =3D 0; -+ if (QWindowSystemInterface::handleNativeEvent(window, nativeEventType= (), &msg, &filterResult)) { -+ *result =3D LRESULT(filterResult); -+ return true; -+ } -+ return false; -+} -+ -+QT_END_NAMESPACE --- = -2.17.1 - diff --git a/3rdparty/ext_qt/gerrit-212811_qtbase-angle-d3d11-warp-crash-fi= x.patch b/3rdparty/ext_qt/gerrit-189539-ANGLE-mingw-fix.patch similarity index 86% copy from 3rdparty/ext_qt/gerrit-212811_qtbase-angle-d3d11-warp-crash-fix.p= atch copy to 3rdparty/ext_qt/gerrit-189539-ANGLE-mingw-fix.patch index 629530cbc48..93bb2a47ea6 100644 --- a/3rdparty/ext_qt/gerrit-212811_qtbase-angle-d3d11-warp-crash-fix.patch +++ b/3rdparty/ext_qt/gerrit-189539-ANGLE-mingw-fix.patch @@ -1,16 +1,5 @@ -From 55100c8f5bb5d951fe20255ef99e02d26f5a8323 Mon Sep 17 00:00:00 2001 -From: Boudewijn Rempt -Date: Mon, 23 Jul 2018 11:53:53 +0200 -Subject: [PATCH 7/8] gerrit-189539-ANGLE-mingw-fix.patch - ---- - qtbase/src/angle/src/common/common.pri | 16 +------ - qtbase/src/gui/configure.json | 14 ++++-- - qtbase/src/gui/configure.pri | 64 ++++++++++++++++++++------ - 3 files changed, 59 insertions(+), 35 deletions(-) - diff --git a/qtbase/src/angle/src/common/common.pri b/qtbase/src/angle/src= /common/common.pri -index c1fad1495..6a558a957 100644 +index c1fad14951..6a558a957b 100644 --- a/qtbase/src/angle/src/common/common.pri +++ b/qtbase/src/angle/src/common/common.pri @@ -21,20 +21,6 @@ lib_replace.replace =3D \$\$\$\$[QT_INSTALL_LIBS] @@ -36,10 +25,10 @@ index c1fad1495..6a558a957 100644 = static: DEFINES *=3D LIBGLESV2_EXPORT_H_ ANGLE_EXPORT=3D diff --git a/qtbase/src/gui/configure.json b/qtbase/src/gui/configure.json -index 219385a10..41241597f 100644 +index 28c8034c75..77cfb6b592 100644 --- a/qtbase/src/gui/configure.json +++ b/qtbase/src/gui/configure.json -@@ -656,11 +656,14 @@ +@@ -615,11 +615,14 @@ "label": "DirectX SDK", "type": "directX", "files": [ @@ -57,7 +46,7 @@ index 219385a10..41241597f 100644 "egl-x11": { "label": "EGL on X11", "type": "compile", -@@ -909,10 +912,11 @@ +@@ -842,10 +845,11 @@ "angle": { "label": "ANGLE", "autoDetect": "features.opengles2 || features.opengl-dynamic", @@ -72,7 +61,7 @@ index 219385a10..41241597f 100644 }, "angle_d3d11_qdtd": { diff --git a/qtbase/src/gui/configure.pri b/qtbase/src/gui/configure.pri -index fcd2d1f73..39a5b987a 100644 +index aaffa835dc..566686b4f6 100644 --- a/qtbase/src/gui/configure.pri +++ b/qtbase/src/gui/configure.pri @@ -15,22 +15,12 @@ defineTest(qtConfLibrary_freetype) { @@ -138,7 +127,7 @@ index fcd2d1f73..39a5b987a 100644 + } + } + } -+ } ++ } + } + + !isEmpty(fxc):exists($$fxc) { @@ -151,9 +140,6 @@ index fcd2d1f73..39a5b987a 100644 + return(false) +} + - defineTest(qtConfTest_qpaDefaultPlatform) { - name =3D - !isEmpty(config.input.qpa_default_platform): name =3D $$config.input.= qpa_default_platform --- = -2.17.1 - + defineTest(qtConfTest_xkbConfigRoot) { + qtConfTest_getPkgConfigVariable($${1}): return(true) + = diff --git a/3rdparty/ext_qt/gerrit-212811_qtbase-angle-d3d11-warp-crash-fi= x.patch b/3rdparty/ext_qt/gerrit-212811_qtbase-angle-d3d11-warp-crash-fix.p= atch index 629530cbc48..ff9ddf96e14 100644 --- a/3rdparty/ext_qt/gerrit-212811_qtbase-angle-d3d11-warp-crash-fix.patch +++ b/3rdparty/ext_qt/gerrit-212811_qtbase-angle-d3d11-warp-crash-fix.patch @@ -1,159 +1,50 @@ -From 55100c8f5bb5d951fe20255ef99e02d26f5a8323 Mon Sep 17 00:00:00 2001 -From: Boudewijn Rempt -Date: Mon, 23 Jul 2018 11:53:53 +0200 -Subject: [PATCH 7/8] gerrit-189539-ANGLE-mingw-fix.patch +commit 644ff9428853f138649de0419de4b49bf41bc738 +Author: Oliver Wolff +Date: Tue Nov 28 13:30:52 2017 +0100 = ---- - qtbase/src/angle/src/common/common.pri | 16 +------ - qtbase/src/gui/configure.json | 14 ++++-- - qtbase/src/gui/configure.pri | 64 ++++++++++++++++++++------ - 3 files changed, 59 insertions(+), 35 deletions(-) + ANGLE: D3D11: Fix shared handle support detection for WARP when MinGW = is used + = + The MinGW version we support supports IsWindows8OrGreater so that we c= an + check the windows version properly. As the OpenGL detection falls back + to WARP in case of RDP it was possible, that shared handles were wrong= ly + 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 + (cherry picked from commit 6508fdca1dcc7105947befadba272d0fd4bbc27f) = -diff --git a/qtbase/src/angle/src/common/common.pri b/qtbase/src/angle/src= /common/common.pri -index c1fad1495..6a558a957 100644 ---- a/qtbase/src/angle/src/common/common.pri -+++ b/qtbase/src/angle/src/common/common.pri -@@ -21,20 +21,6 @@ lib_replace.replace =3D \$\$\$\$[QT_INSTALL_LIBS] - lib_replace.CONFIG =3D path - QMAKE_PRL_INSTALL_REPLACE +=3D lib_replace +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 0173311bc6..5118bdbe9c 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 = --# DirectX is included in the Windows 8 Kit, but everything else requires = the DX SDK. --winrt|msvc { -- FXC =3D fxc.exe --} else { -- DX_DIR =3D $$(DXSDK_DIR) -- isEmpty(DX_DIR) { -- error("Cannot determine DirectX SDK location. Please set DXSDK_DI= R environment variable.") -- } -- -- equals(QMAKE_TARGET.arch, x86_64) { -- FXC =3D \"$${DX_DIR}Utilities\\bin\\x64\\fxc.exe\" -- } else { -- FXC =3D \"$${DX_DIR}Utilities\\bin\\x86\\fxc.exe\" -- } --} -+FXC =3D $$QMAKE_FXC_LOCATION - = - static: DEFINES *=3D LIBGLESV2_EXPORT_H_ ANGLE_EXPORT=3D -diff --git a/qtbase/src/gui/configure.json b/qtbase/src/gui/configure.json -index 219385a10..41241597f 100644 ---- a/qtbase/src/gui/configure.json -+++ b/qtbase/src/gui/configure.json -@@ -656,11 +656,14 @@ - "label": "DirectX SDK", - "type": "directX", - "files": [ -- "d3dcompiler.h", -- "d3d11.lib", -- "fxc.exe" -+ "d3dcompiler.h" - ] - }, -+ "fxc": { -+ "label": "DirectX Shader Compiler", -+ "type": "fxc", -+ "log": "value" -+ }, - "egl-x11": { - "label": "EGL on X11", - "type": "compile", -@@ -909,10 +912,11 @@ - "angle": { - "label": "ANGLE", - "autoDetect": "features.opengles2 || features.opengl-dynamic", -- "condition": "config.win32 && tests.directx", -+ "condition": "config.win32 && tests.directx && tests.fxc", - "output": [ - "publicFeature", -- { "type": "define", "name": "QT_OPENGL_ES_2_ANGLE" } -+ { "type": "define", "name": "QT_OPENGL_ES_2_ANGLE" }, -+ { "type": "varAssign", "name": "QMAKE_FXC_LOCATION", "val= ue": "tests.fxc.value" } - ] - }, - "angle_d3d11_qdtd": { -diff --git a/qtbase/src/gui/configure.pri b/qtbase/src/gui/configure.pri -index fcd2d1f73..39a5b987a 100644 ---- a/qtbase/src/gui/configure.pri -+++ b/qtbase/src/gui/configure.pri -@@ -15,22 +15,12 @@ defineTest(qtConfLibrary_freetype) { - return(true) - } - = --# Check for Direct X SDK (include, lib, and direct shader compiler 'fxc'). --# Up to Direct X SDK June 2010 and for MinGW, this is pointed to by the --# DXSDK_DIR variable. Starting with Windows Kit 8, it is included in --# the Windows SDK. Checking for the header is not sufficient, since it --# is also present in MinGW. -+# For MSVC everything DirectX related is included in Windows Kit >=3D 8, -+# so we do not do any magic in this case. -+# For MinGW we need the shader compiler (fxc.exe), which -+# are not part of MinGW. They can either be obtained from a DirectX SDK -+# (keep the old approach working) or Windows Kit (>=3D 8). - defineTest(qtConfTest_directX) { -- dxdir =3D $$getenv("DXSDK_DIR") -- !isEmpty(dxdir) { -- EXTRA_INCLUDEPATH +=3D $$dxdir/include -- equals(QT_ARCH, x86_64): \ -- EXTRA_LIBDIR +=3D $$dxdir/lib/x64 -- else: \ -- EXTRA_LIBDIR +=3D $$dxdir/lib/x86 -- EXTRA_PATH +=3D $$dxdir/Utilities/bin/x86 -- } -- - $$qtConfEvaluate("features.sse2") { - ky =3D $$size($${1}.files._KEYS_) - $${1}.files._KEYS_ +=3D $$ky -@@ -42,6 +32,50 @@ defineTest(qtConfTest_directX) { - return(false) - } - = -+defineTest(qtConfTest_fxc) { -+ !mingw { -+ fxc =3D $$qtConfFindInPath("fxc.exe") -+ } else { -+ dxdir =3D $$getenv("DXSDK_DIR") -+ winkitdir =3D $$getenv("WindowsSdkDir") -+ !isEmpty(dxdir) { -+ equals(QT_ARCH, x86_64): \ -+ fxc =3D $$dxdir/Utilities/bin/x64/fxc.exe -+ else: \ -+ fxc =3D $$dxdir/Utilities/bin/x86/fxc.exe -+ } else: !isEmpty(winkitdir) { -+ equals(QT_ARCH, x86_64): \ -+ fxc =3D $$winkitdir/bin/x64/fxc.exe -+ else: \ -+ fxc =3D $$winkitdir/bin/x86/fxc.exe -+ -+ !exists($$fxc) { -+ binsubdirs =3D $$files($$winkitdir/bin/*) -+ for (dir, binsubdirs) { -+ equals(QT_ARCH, x86_64): \ -+ finalBinDir =3D $$dir/x64 -+ else: \ -+ finalBinDir =3D $$dir/x86 -+ -+ fxc =3D $${finalBinDir}/fxc.exe -+ exists($$fxc) { -+ break() -+ } -+ } -+ } -+ } -+ } -+ -+ !isEmpty(fxc):exists($$fxc) { -+ $${1}.value =3D $$fxc -+ export($${1}.value) -+ $${1}.cache +=3D value -+ export($${1}.cache) -+ return(true) -+ } -+ return(false) -+} -+ - defineTest(qtConfTest_qpaDefaultPlatform) { - name =3D - !isEmpty(config.input.qpa_default_platform): name =3D $$config.input.= qpa_default_platform --- = -2.17.1 - + if (deviceType =3D=3D 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 dc091b0497..f42ff2141b 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 =3D=3D 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/Renderer1= 1.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 diff --git a/3rdparty/ext_qt/mac-default.patch b/3rdparty/ext_qt/mac-defaul= t.patch new file mode 100644 index 00000000000..016240c48c4 --- /dev/null +++ b/3rdparty/ext_qt/mac-default.patch @@ -0,0 +1,11 @@ +--- old/default_pre.prf 2016-06-10 02:48:56.000000000 -0400 ++++ new/default_pre.prf 2016-09-21 02:39:08.000000000 -0400 +@@ -12,7 +12,7 @@ + error("Xcode is not installed in $${QMAKE_XCODE_DEVELOPER_PATH}. = Please use xcode-select to choose Xcode installation path.") + = + # Make sure Xcode is set up properly +- isEmpty($$list($$system("/usr/bin/xcrun -find xcrun 2>/dev/null"))): \ ++ isEmpty($$list($$system("/usr/bin/xcrun -find xcodebuild 2>/dev/null"= ))): \ + error("Xcode not set up properly. You may need to confirm the lic= ense agreement by running /usr/bin/xcodebuild.") + } + = diff --git a/3rdparty/ext_qt/mac_standardpaths_qtbug-61159.diff b/3rdparty/= ext_qt/mac_standardpaths_qtbug-61159.diff new file mode 100644 index 00000000000..b0a33ed8337 --- /dev/null +++ b/3rdparty/ext_qt/mac_standardpaths_qtbug-61159.diff @@ -0,0 +1,59 @@ +diff --git a/src/corelib/io/qstandardpaths_mac.mm b/src/corelib/io/qstanda= rdpaths_mac.mm +index e25339a..3bb7a78 100644 +--- a/src/corelib/io/qstandardpaths_mac.mm ++++ b/src/corelib/io/qstandardpaths_mac.mm +@@ -196,42 +196,31 @@ + it !=3D masks.end(); ++it) { + const QString path =3D baseWritableLocation(type, *it, true); + if (!path.isEmpty() && !dirs.contains(path)) + dirs.append(path); + } + } + = + if (type =3D=3D AppDataLocation || type =3D=3D AppLocalDataLocation) { + CFBundleRef mainBundle =3D CFBundleGetMainBundle(); + if (mainBundle) { +- CFURLRef bundleUrl =3D CFBundleCopyBundleURL(mainBundle); +- CFStringRef cfBundlePath =3D CFURLCopyFileSystemPath(bundleUr= l, kCFURLPOSIXPathStyle); +- QString bundlePath =3D QString::fromCFString(cfBundlePath); +- CFRelease(cfBundlePath); +- CFRelease(bundleUrl); +- +- CFURLRef resourcesUrl =3D CFBundleCopyResourcesDirectoryURL(m= ainBundle); +- CFStringRef cfResourcesPath =3D CFURLCopyFileSystemPath(resou= rcesUrl, +- kCFURLPOSIXPathStyle); +- QString resourcesPath =3D QString::fromCFString(cfResourcesPa= th); +- CFRelease(cfResourcesPath); +- CFRelease(resourcesUrl); +- +- // Handle bundled vs unbundled executables. CFBundleGetMainBu= ndle() returns +- // a valid bundle in both cases. CFBundleCopyResourcesDirecto= ryURL() returns +- // an absolute path for unbundled executables. +- if (resourcesPath.startsWith(QLatin1Char('/'))) +- dirs.append(resourcesPath); +- else +- dirs.append(bundlePath + resourcesPath); +- } +- } ++ if (QCFType resourcesURL =3D CFBundleCopyResourcesD= irectoryURL(mainBundle)) { ++ if (QCFType absoluteResouresURL =3D CFURLCopyAb= soluteURL(resourcesURL)) { ++ if (QCFType path =3D CFURLCopyFileSystem= Path(absoluteResouresURL, ++ = kCFURLPOSIXPathStyle)) { ++ dirs.append(QString::fromCFString(path)); ++ } ++ } ++ } ++ } ++ } ++ + const QString localDir =3D writableLocation(type); + if (!localDir.isEmpty()) + dirs.prepend(localDir); + return dirs; + } + = + #ifndef QT_BOOTSTRAPPED + QString QStandardPaths::displayName(StandardLocation type) + { + // Use "Home" instead of the user's Unix username + diff --git a/3rdparty/ext_qt/macdeploy-qt.diff b/3rdparty/ext_qt/macdeploy-= qt.diff index 7c8dafcba1a..f871cff882b 100644 --- a/3rdparty/ext_qt/macdeploy-qt.diff +++ b/3rdparty/ext_qt/macdeploy-qt.diff @@ -1,27 +1,22 @@ -From ce15361bb0f077267454216a8e7e0ccfa6b56020 Mon Sep 17 00:00:00 2001 -From: Boudewijn Rempt -Date: Mon, 23 Jul 2018 12:04:52 +0200 -Subject: [PATCH 8/8] macdeploy-qt.diff +commit 26d6c76d5a51504ebabec5f4ea2643069743f962 +Author: Boudewijn Rempt +Date: Sat Nov 4 14:15:25 2017 +0100 = ---- - qttools/src/macdeployqt/macdeployqt/main.cpp | 16 ++++++- - qttools/src/macdeployqt/shared/shared.cpp | 47 ++++++++++++++++++++ - qttools/src/macdeployqt/shared/shared.h | 1 + - 3 files changed, 62 insertions(+), 2 deletions(-) + Fix macdeployqt = diff --git a/qttools/src/macdeployqt/macdeployqt/main.cpp b/qttools/src/ma= cdeployqt/macdeployqt/main.cpp -index 90a5412b2..537af266b 100644 +index 5488a5f..1e90c72 100644 --- a/qttools/src/macdeployqt/macdeployqt/main.cpp +++ b/qttools/src/macdeployqt/macdeployqt/main.cpp -@@ -54,6 +54,7 @@ int main(int argc, char **argv) +@@ -53,6 +53,7 @@ int main(int argc, char **argv) + qDebug() << " -codesign=3D : Run codesign with the give= n identity on all executables"; qDebug() << " -appstore-compliant: Skip deployment of component= s that use private API"; qDebug() << " -libpath=3D : Add the given path to the = library search path"; - qDebug() << " -fs=3D : Set the filesystem used fo= r the .dmg disk image (defaults to HFS+)"; + qDebug() << " -extra-plugins=3D : Deploy plugins from given = extra directory"; qDebug() << ""; qDebug() << "macdeployqt takes an application bundle as input and= makes it"; qDebug() << "self-contained by copying in the Qt frameworks and p= lugins that"; -@@ -96,6 +97,7 @@ int main(int argc, char **argv) +@@ -94,6 +95,7 @@ int main(int argc, char **argv) extern QString codesignIdentiy; extern bool appstoreCompliant; extern bool deployFramework; @@ -29,10 +24,10 @@ index 90a5412b2..537af266b 100644 = for (int i =3D 2; i < argc; ++i) { QByteArray argument =3D QByteArray(argv[i]); -@@ -171,6 +173,13 @@ int main(int argc, char **argv) - LogError() << "Missing filesystem type"; - else - filesystem =3D argument.mid(index+1); +@@ -162,6 +164,14 @@ int main(int argc, char **argv) + LogDebug() << "Argument found:" << argument; + deployFramework =3D true; + = + } else if (argument.startsWith(QByteArray("-extra-plugins"))) { + LogDebug() << "Argument found:" << argument; + int index =3D argument.indexOf('=3D'); @@ -40,10 +35,11 @@ index 90a5412b2..537af266b 100644 + LogError() << "Missing extra plugins directory"; + else + extraPluginDirectories << argument.mid(index+1); ++ } else if (argument.startsWith("-")) { LogError() << "Unknown argument" << argument << "\n"; return 1; -@@ -201,10 +210,13 @@ int main(int argc, char **argv) +@@ -192,10 +202,13 @@ int main(int argc, char **argv) deploymentInfo.deployedFrameworks =3D deploymentInfo.deployedFram= eworks.toSet().toList(); } = @@ -60,10 +56,10 @@ index 90a5412b2..537af266b 100644 } = diff --git a/qttools/src/macdeployqt/shared/shared.cpp b/qttools/src/macde= ployqt/shared/shared.cpp -index bef3543dc..0e57d9063 100644 +index 9575090..477f7a0 100644 --- a/qttools/src/macdeployqt/shared/shared.cpp +++ b/qttools/src/macdeployqt/shared/shared.cpp -@@ -1130,6 +1130,43 @@ void deployPlugins(const ApplicationBundleInfo &app= BundleInfo, const QString &pl +@@ -1120,6 +1120,43 @@ void deployPlugins(const ApplicationBundleInfo &app= BundleInfo, const QString &pl } } = @@ -107,7 +103,7 @@ index bef3543dc..0e57d9063 100644 void createQtConf(const QString &appBundlePath) { // Set Plugins and imports paths. These are relative to App.app/Conte= nts. -@@ -1171,6 +1208,16 @@ void deployPlugins(const QString &appBundlePath, De= ploymentInfo deploymentInfo, +@@ -1161,6 +1198,16 @@ void deployPlugins(const QString &appBundlePath, De= ploymentInfo deploymentInfo, deployPlugins(applicationBundle, deploymentInfo.pluginPath, pluginDes= tinationPath, deploymentInfo, useDebugLibs); } = @@ -125,7 +121,7 @@ index bef3543dc..0e57d9063 100644 { QString importDestinationPath =3D appBundlePath + "/Contents/Resource= s/qml/" + importName; diff --git a/qttools/src/macdeployqt/shared/shared.h b/qttools/src/macdepl= oyqt/shared/shared.h -index c4d60ea0a..0b8d576fe 100644 +index c173846..cceac3a 100644 --- a/qttools/src/macdeployqt/shared/shared.h +++ b/qttools/src/macdeployqt/shared/shared.h @@ -116,6 +116,7 @@ DeploymentInfo deployQtFrameworks(const QString &appBu= ndlePath, const QStringLis @@ -136,6 +132,3 @@ index c4d60ea0a..0b8d576fe 100644 bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploy= mentInfo, QStringList &qmlDirs); void changeIdentification(const QString &id, const QString &binaryPath); void changeInstallName(const QString &oldName, const QString &newName, co= nst QString &binaryPath); --- = -2.17.1 - diff --git a/3rdparty/ext_qt/qopengldebug-gles.patch b/3rdparty/ext_qt/qope= ngldebug-gles.patch index 8242ccbbfdb..448364ebbf4 100644 --- a/3rdparty/ext_qt/qopengldebug-gles.patch +++ b/3rdparty/ext_qt/qopengldebug-gles.patch @@ -1,14 +1,5 @@ -From 6f5a3165c03e285690e37fbcbeabe5fc16c5b932 Mon Sep 17 00:00:00 2001 -From: Boudewijn Rempt -Date: Mon, 23 Jul 2018 11:51:38 +0200 -Subject: [PATCH 6/8] qopengldebug-gles.patch - ---- - qtbase/src/gui/opengl/qopengldebug.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - diff --git a/qtbase/src/gui/opengl/qopengldebug.cpp b/qtbase/src/gui/openg= l/qopengldebug.cpp -index f6c3af37d..70bf7530e 100644 +index f6c3af37dd..70bf7530e1 100644 --- a/qtbase/src/gui/opengl/qopengldebug.cpp +++ b/qtbase/src/gui/opengl/qopengldebug.cpp @@ -1413,7 +1413,7 @@ bool QOpenGLDebugLogger::initialize() @@ -20,6 +11,3 @@ index f6c3af37d..70bf7530e 100644 ); = GET_DEBUG_PROC_ADDRESS(glDebugMessageControl); --- = -2.17.1 - diff --git a/3rdparty/ext_qt/qt-no-motion-compression.diff b/3rdparty/ext_q= t/qt-no-motion-compression.diff new file mode 100644 index 00000000000..bac29953b99 --- /dev/null +++ b/3rdparty/ext_qt/qt-no-motion-compression.diff @@ -0,0 +1,20 @@ +diff --git a/qtbase/src/plugins/platforms/xcb/qxcbconnection.cpp b/qtbase/= src/plugins/platforms/xcb/qxcbconnection.cpp +index 05c0224..8fa9345 100644 +--- a/qtbase/src/plugins/platforms/xcb/qxcbconnection.cpp ++++ b/qtbase/src/plugins/platforms/xcb/qxcbconnection.cpp +@@ -1687,8 +1687,13 @@ void QXcbConnection::processXcbEvents() + continue; + } + = +- if (compressEvent(event, i, eventqueue)) +- continue; ++ ++ /** ++ * (Krita) Do *NOT* compress any motion events! This is the ++ * most weird thing one can do for a painting application! ++ */ ++ // if (compressEvent(event, i, eventqueue)) ++ // continue; + = + bool accepted =3D false; + if (clipboard()->processIncr()) diff --git a/3rdparty/ext_qt/qtgui-private-headers.diff b/3rdparty/ext_qt/q= tgui-private-headers.diff index 81cf1fd9e53..3e719feab61 100644 --- a/3rdparty/ext_qt/qtgui-private-headers.diff +++ b/3rdparty/ext_qt/qtgui-private-headers.diff @@ -1,31 +1,12 @@ -From 74271b0ebb277d51ed4baa70cfb1572acd7dae8d Mon Sep 17 00:00:00 2001 -From: Boudewijn Rempt -Date: Mon, 23 Jul 2018 11:43:18 +0200 -Subject: [PATCH 2/8] qtgui-private-headers.diff - ---- - qtbase/mkspecs/features/create_cmake.prf | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - diff --git a/qtbase/mkspecs/features/create_cmake.prf b/qtbase/mkspecs/fea= tures/create_cmake.prf -index 2ed708e08..b82393854 100644 +index 11fb52a..aec9ea9 100644 --- a/qtbase/mkspecs/features/create_cmake.prf +++ b/qtbase/mkspecs/features/create_cmake.prf -@@ -28,10 +28,10 @@ CMAKE_OUT_DIR =3D $$MODULE_BASE_OUTDIR/lib/cmake - = - CMAKE_MODULE_NAME =3D $$cmakeModuleName($${MODULE}) - = --!generated_privates { -- isEmpty(SYNCQT.INJECTED_PRIVATE_HEADER_FILES):isEmpty(SYNCQT.PRIVATE_= HEADER_FILES): \ -- CMAKE_NO_PRIVATE_INCLUDES =3D true --} -+#!generated_privates { -+# isEmpty(SYNCQT.INJECTED_PRIVATE_HEADER_FILES):isEmpty(SYNCQT.PRIVATE= _HEADER_FILES): \ -+# CMAKE_NO_PRIVATE_INCLUDES =3D true -+#} +@@ -30,7 +30,6 @@ CMAKE_MODULE_NAME =3D $$cmakeModuleName($${MODULE}) = split_incpath { CMAKE_ADD_SOURCE_INCLUDE_DIRS =3D true --- = -2.17.1 - +- CMAKE_NO_PRIVATE_INCLUDES =3D true # Don't add private includes in th= e build dir which don't exist + CMAKE_SOURCE_INCLUDES =3D \ + $$cmakeTargetPaths($$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_B= ASE/Qt$${CMAKE_MODULE_NAME}) + CMAKE_SOURCE_PRIVATE_INCLUDES =3D \