diff --git a/.github/workflows/scripts/linux/build-dependencies-qt.sh b/.github/workflows/scripts/linux/build-dependencies-qt.sh index e1a12d5aec..942e1b4b89 100755 --- a/.github/workflows/scripts/linux/build-dependencies-qt.sh +++ b/.github/workflows/scripts/linux/build-dependencies-qt.sh @@ -18,7 +18,7 @@ if [ "${INSTALLDIR:0:1}" != "/" ]; then INSTALLDIR="$PWD/$INSTALLDIR" fi -QT=6.12.0 +QT=6.12.1 QTAPNG=1.3.0 FFMPEG=9.0.1 @@ -48,12 +48,12 @@ cd deps-build export PKG_CONFIG_PATH="$INSTALLDIR/lib/pkgconfig:$PKG_CONFIG_PATH" grep . > SHASUMS < SHASUMS < SHASUMS < + ++extern "C" { ++extern int __ulock_wait2(uint32_t operation, void *addr, uint64_t value, ++ uint64_t timeout, uint64_t value2); ++extern int __ulock_wake(uint32_t operation, void *addr, uint64_t wake_value); ++} ++#define UL_COMPARE_AND_WAIT 1 ++#define UL_COMPARE_AND_WAIT64 5 ++#define ULF_WAKE_ALL 0x00000100 ++#define ULF_NO_ERRNO 0x01000000 ++ + #define QT_ALWAYS_USE_FUTEX + + QT_BEGIN_NAMESPACE +@@ -31,12 +41,22 @@ + constexpr bool futexAvailable() { return true; } + + template ++inline uint32_t ulockOperation(Atomic &) ++{ ++ return ULF_NO_ERRNO | (sizeof(typename Atomic::Type) == 4 ? UL_COMPARE_AND_WAIT : UL_COMPARE_AND_WAIT64); ++} ++ ++template + inline void futexWait(Atomic &futex, typename Atomic::Type expectedValue) + { + QtTsan::futexRelease(&futex); + static_assert(sizeof(typename Atomic::Type) == 4 || sizeof(typename Atomic::Type) == 8); ++ if (__builtin_available(macOS 14.4, *)) { + os_sync_wait_on_address(&futex, quint64(expectedValue), sizeof(typename Atomic::Type), + OS_SYNC_WAIT_ON_ADDRESS_NONE); ++ } else { ++ __ulock_wait2(ulockOperation(futex), &futex, uint64_t(expectedValue), 0, 0); ++ } + QtTsan::futexAcquire(&futex); + } + +@@ -45,27 +65,42 @@ + { + QtTsan::futexRelease(&futex); + static_assert(sizeof(typename Atomic::Type) == 4 || sizeof(typename Atomic::Type) == 8); ++ if (__builtin_available(macOS 14.4, *)) { + int r = os_sync_wait_on_address_with_timeout( + &futex, quint64(expectedValue), sizeof(typename Atomic::Type), + OS_SYNC_WAIT_ON_ADDRESS_NONE, OS_CLOCK_MACH_ABSOLUTE_TIME, timer.remainingTimeNSecs()); + QtTsan::futexAcquire(&futex); + return r >= 0 || errno != ETIMEDOUT; ++ } else { ++ int r = __ulock_wait2(ulockOperation(futex), &futex, uint64_t(expectedValue), ++ timer.remainingTimeNSecs(), 0); ++ QtTsan::futexAcquire(&futex); ++ return r == 0 || r != -ETIMEDOUT; ++ } + } + + template + inline void futexWakeAll(Atomic &futex) + { + static_assert(sizeof(typename Atomic::Type) == 4 || sizeof(typename Atomic::Type) == 8); ++ if (__builtin_available(macOS 14.4, *)) { + os_sync_wake_by_address_all(&futex, sizeof(typename Atomic::Type), + OS_SYNC_WAKE_BY_ADDRESS_NONE); ++ } else { ++ __ulock_wake(ulockOperation(futex) | ULF_WAKE_ALL, &futex, 0); ++ } + } + + template + inline void futexWakeOne(Atomic &futex) + { + static_assert(sizeof(typename Atomic::Type) == 4 || sizeof(typename Atomic::Type) == 8); ++ if (__builtin_available(macOS 14.4, *)) { + os_sync_wake_by_address_any(&futex, sizeof(typename Atomic::Type), + OS_SYNC_WAKE_BY_ADDRESS_NONE); ++ } else { ++ __ulock_wake(ulockOperation(futex), &futex, 0); ++ } + } + } //namespace QtDarwinFutex + diff --git a/src/gui/platform/darwin/qappleiconengine.mm b/src/gui/platform/darwin/qappleiconengine.mm --- a/src/gui/platform/darwin/qappleiconengine.mm +++ b/src/gui/platform/darwin/qappleiconengine.mm @@ -91,6 +195,73 @@ diff --git a/src/gui/platform/darwin/qappleiconengine.mm b/src/gui/platform/darw } #elif defined(QT_PLATFORM_UIKIT) auto *configuredImage(const UIImage *image, const QColor &color) +diff --git a/src/gui/rhi/qrhimetal.mm b/src/gui/rhi/qrhimetal.mm +--- a/src/gui/rhi/qrhimetal.mm ++++ b/src/gui/rhi/qrhimetal.mm +@@ -675,6 +675,7 @@ + caps.supportedSampleCounts.append(sampleCount); + } + ++ if (@available(macOS 13, *)) + caps.indirectCommandBuffers = ([d->dev supportsFamily:MTLGPUFamilyApple5] + || [d->dev supportsFamily:MTLGPUFamilyMac2]) + && [d->dev supportsFamily:MTLGPUFamilyMetal3]; +@@ -5351,7 +5352,11 @@ + QString *error, QByteArray *entryPoint, QShaderKey *activeKey) + { + QVarLengthArray versions; +- versions << 30 << 24 << 23 << 22 << 21 << 20 << 12; ++ if (@available(macOS 13, iOS 16, *)) ++ versions << 30; ++ if (@available(macOS 12, iOS 15, *)) ++ versions << 24; ++ versions << 23 << 22 << 21 << 20 << 12; + + const QList shaders = shader.availableShaders(); + +diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm +--- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm ++++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm +@@ -420,8 +420,10 @@ + + - (BOOL)applicationSupportsSecureRestorableState:(NSApplication *)application + { ++ if (@available(macOS 12, *)) { + if ([reflectionDelegate respondsToSelector:_cmd]) + return [reflectionDelegate applicationSupportsSecureRestorableState:application]; ++ } + + // We don't support or implement state restorations via the AppKit + // state restoration APIs, but if we did, we would/should support +diff --git a/src/plugins/platforms/cocoa/qcocoascreen.mm b/src/plugins/platforms/cocoa/qcocoascreen.mm +--- a/src/plugins/platforms/cocoa/qcocoascreen.mm ++++ b/src/plugins/platforms/cocoa/qcocoascreen.mm +@@ -623,6 +623,7 @@ + } + + auto grabFromDisplay = [](CGDirectDisplayID displayId, const QRect &grabRect) -> QPixmap { ++ if (@available(macOS 14.4, *)) { + QMacAutoReleasePool pool; + + const qreal scale = QCocoaScreen::nativeScreenForDisplayId(displayId).backingScaleFactor; +@@ -713,6 +714,17 @@ + QPixmap pixmap = QPixmap::fromImage(image); + pixmap.setDevicePixelRatio(scale); + return pixmap; ++ } else { ++ QCFType image = CGDisplayCreateImageForRect(displayId, grabRect.toCGRect()); ++ const QCFType sRGBcolorSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB); ++ if (CGImageGetColorSpace(image) != sRGBcolorSpace) { ++ qCDebug(lcQpaScreen) << "applying color correction for display" << displayId; ++ image = CGImageCreateCopyWithColorSpace(image, sRGBcolorSpace); ++ } ++ QPixmap pixmap = QPixmap::fromImage(qt_mac_toQImage(image)); ++ pixmap.setDevicePixelRatio(nativeScreenForDisplayId(displayId).backingScaleFactor); ++ return pixmap; ++ } + }; + + QRect grabRect = QRect(x, y, width, height); diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm diff --git a/.github/workflows/scripts/windows/build-dependencies-arm64.bat b/.github/workflows/scripts/windows/build-dependencies-arm64.bat index e25811b8d1..592cac2594 100644 --- a/.github/workflows/scripts/windows/build-dependencies-arm64.bat +++ b/.github/workflows/scripts/windows/build-dependencies-arm64.bat @@ -57,7 +57,7 @@ echo INSTALLDIR=%INSTALLDIR% cd "%BUILDDIR%" -set QT=6.12.0 +set QT=6.12.1 set QTMINOR=6.12 set QTAPNG=1.3.0 @@ -96,11 +96,11 @@ set AGILITYSDK=1.620.2 set DXHEADERS=1.620.2 set DXC=1.9.2609.5 -call :downloadfile "qtbase-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtbase-everywhere-src-%QT%.zip" 0529901575c413e34ded504eeda177c4a6dfd0dff1e39ed52c811dc5204b43c7 || goto error -call :downloadfile "qtimageformats-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtimageformats-everywhere-src-%QT%.zip" 664de2ba60a1e74105da844c061688ff5e6f8f046d5dd98e2d6b6ad3c553b4ca || goto error -call :downloadfile "qtsvg-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtsvg-everywhere-src-%QT%.zip" a633ce8978543a7c72c1381d3a52bb424e8ba629882dfb39dfd29508cb4f125d || goto error -call :downloadfile "qttools-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttools-everywhere-src-%QT%.zip" 42e4aee011c429c1e6a51cb40f398b5126c8185ab4f493f9e0ce3c4cbce6f4b7 || goto error -call :downloadfile "qttranslations-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttranslations-everywhere-src-%QT%.zip" 286f0ca3ad669bc2d6fec0e209a797a08049d037c7a167e60eb3b4a640405aa5 || goto error +call :downloadfile "qtbase-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtbase-everywhere-src-%QT%.zip" b6e3d1eeff882e75cd81b95bf73af33a1209e4f829bc3e3d4b15d938e39bf2af || goto error +call :downloadfile "qtimageformats-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtimageformats-everywhere-src-%QT%.zip" 8f61ad3ba4e4f849d98ed76033db67078b49fcbe8ac10af0e81c9357777c698a || goto error +call :downloadfile "qtsvg-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtsvg-everywhere-src-%QT%.zip" 384c9d4c237929be99baec19480cdf4f92554b0d489180659a1886d4ec1c1d83 || goto error +call :downloadfile "qttools-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttools-everywhere-src-%QT%.zip" c6b088ce34da067ed26720c488bff3f9aa8083891663e92a4029c03eeac631f3 || goto error +call :downloadfile "qttranslations-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttranslations-everywhere-src-%QT%.zip" de90ad5524c10a05690d43824e325f8dcd5aedcec84196d68ee4a4912f95e5f3 || goto error call :downloadfile "QtApng-%QTAPNG%.zip" "https://github.com/jurplel/QtApng/archive/refs/tags/%QTAPNG%.zip" 5176082cdd468047a7eb1ec1f106b032f57df207aa318d559b29606b00d159ac || goto error call :downloadfile "ffmpeg-%FFMPEG%.tar.xz" "https://ffmpeg.org/releases/ffmpeg-%FFMPEG%.tar.xz" cf38e0e28c7e5605942c4a77755349b0145804a397af37eb1fb4c77cb237f635 || goto error diff --git a/.github/workflows/scripts/windows/build-dependencies.bat b/.github/workflows/scripts/windows/build-dependencies.bat index 2ea3a9d492..553c0818d9 100644 --- a/.github/workflows/scripts/windows/build-dependencies.bat +++ b/.github/workflows/scripts/windows/build-dependencies.bat @@ -55,7 +55,7 @@ set "PATH=%PATH%;%INSTALLDIR%\bin" cd "%BUILDDIR%" -set QT=6.12.0 +set QT=6.12.1 set QTMINOR=6.12 set QTAPNG=1.3.0 @@ -96,11 +96,11 @@ set AGILITYSDK=1.620.2 set DXHEADERS=1.620.2 set DXC=1.9.2609.5 -call :downloadfile "qtbase-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtbase-everywhere-src-%QT%.zip" 0529901575c413e34ded504eeda177c4a6dfd0dff1e39ed52c811dc5204b43c7 || goto error -call :downloadfile "qtimageformats-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtimageformats-everywhere-src-%QT%.zip" 664de2ba60a1e74105da844c061688ff5e6f8f046d5dd98e2d6b6ad3c553b4ca || goto error -call :downloadfile "qtsvg-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtsvg-everywhere-src-%QT%.zip" a633ce8978543a7c72c1381d3a52bb424e8ba629882dfb39dfd29508cb4f125d || goto error -call :downloadfile "qttools-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttools-everywhere-src-%QT%.zip" 42e4aee011c429c1e6a51cb40f398b5126c8185ab4f493f9e0ce3c4cbce6f4b7 || goto error -call :downloadfile "qttranslations-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttranslations-everywhere-src-%QT%.zip" 286f0ca3ad669bc2d6fec0e209a797a08049d037c7a167e60eb3b4a640405aa5 || goto error +call :downloadfile "qtbase-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtbase-everywhere-src-%QT%.zip" b6e3d1eeff882e75cd81b95bf73af33a1209e4f829bc3e3d4b15d938e39bf2af || goto error +call :downloadfile "qtimageformats-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtimageformats-everywhere-src-%QT%.zip" 8f61ad3ba4e4f849d98ed76033db67078b49fcbe8ac10af0e81c9357777c698a || goto error +call :downloadfile "qtsvg-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtsvg-everywhere-src-%QT%.zip" 384c9d4c237929be99baec19480cdf4f92554b0d489180659a1886d4ec1c1d83 || goto error +call :downloadfile "qttools-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttools-everywhere-src-%QT%.zip" c6b088ce34da067ed26720c488bff3f9aa8083891663e92a4029c03eeac631f3 || goto error +call :downloadfile "qttranslations-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qttranslations-everywhere-src-%QT%.zip" de90ad5524c10a05690d43824e325f8dcd5aedcec84196d68ee4a4912f95e5f3 || goto error call :downloadfile "QtApng-%QTAPNG%.zip" "https://github.com/jurplel/QtApng/archive/refs/tags/%QTAPNG%.zip" 5176082cdd468047a7eb1ec1f106b032f57df207aa318d559b29606b00d159ac || goto error call :downloadfile "ffmpeg-%FFMPEG%.tar.xz" "https://ffmpeg.org/releases/ffmpeg-%FFMPEG%.tar.xz" cf38e0e28c7e5605942c4a77755349b0145804a397af37eb1fb4c77cb237f635 || goto error