From 0f814403d27275089526c1a53b6e40371ae7a204 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 3 Jan 2023 21:12:35 +0100 Subject: [PATCH] depends: qt: cocoa no application badge --- contrib/depends/packages/qt.mk | 4 +++ .../depends/patches/qt/cocoa-no-badge.patch | 28 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 contrib/depends/patches/qt/cocoa-no-badge.patch diff --git a/contrib/depends/packages/qt.mk b/contrib/depends/packages/qt.mk index efc78c8..1513a1f 100644 --- a/contrib/depends/packages/qt.mk +++ b/contrib/depends/packages/qt.mk @@ -10,6 +10,7 @@ $(package)_linux_dependencies=openssl native_qt freetype fontconfig libxcb libxk $(package)_qt_libs=corelib network widgets gui plugins testlib $(package)_linguist_tools = lrelease lupdate lconvert $(package)_patches = aarch64Toolchain.cmake +$(package)_patches += cocoa-no-badge.patch $(package)_patches += dont_hardcode_pwd.patch $(package)_patches += fast_fixed_dtoa_no_optimize.patch $(package)_patches += gnueabihfToolchain.cmake @@ -263,6 +264,9 @@ define $(package)_preprocess_cmds mv $($(package)_patch_dir)/MacToolchain.cmake . && \ mv $($(package)_patch_dir)/aarch64Toolchain.cmake . && \ mv $($(package)_patch_dir)/gnueabihfToolchain.cmake . && \ + cd qtbase && \ + patch -p1 -i $($(package)_patch_dir)/cocoa-no-badge.patch && \ + cd .. && \ cd qtmultimedia && \ patch -p1 -i $($(package)_patch_dir)/qtmultimedia-fixes.patch && \ patch -p1 -i $($(package)_patch_dir)/v4l2.patch && \ diff --git a/contrib/depends/patches/qt/cocoa-no-badge.patch b/contrib/depends/patches/qt/cocoa-no-badge.patch new file mode 100644 index 0000000..07709b1 --- /dev/null +++ b/contrib/depends/patches/qt/cocoa-no-badge.patch @@ -0,0 +1,28 @@ +diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.h b/src/plugins/platforms/cocoa/qcocoaintegration.h +index 256b7b36ad..c6d73e3c06 100644 +--- a/src/plugins/platforms/cocoa/qcocoaintegration.h ++++ b/src/plugins/platforms/cocoa/qcocoaintegration.h +@@ -90,7 +90,6 @@ public: + void clearToolbars(); + + void setApplicationIcon(const QIcon &icon) const override; +- void setApplicationBadge(qint64 number) override; + + void beep() const override; + void quit() const override; +diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm +index 2ec225cbea..b17ab38b10 100644 +--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm ++++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm +@@ -438,11 +438,6 @@ void QCocoaIntegration::setApplicationIcon(const QIcon &icon) const + NSApp.applicationIconImage = [NSImage imageFromQIcon:icon withSize:fallbackSize]; + } + +-void QCocoaIntegration::setApplicationBadge(qint64 number) +-{ +- NSApp.dockTile.badgeLabel = number ? [NSString stringWithFormat:@"%" PRId64, number] : nil; +-} +- + void QCocoaIntegration::beep() const + { + NSBeep();