Loading pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/default.nix +3 −7 Original line number Diff line number Diff line Loading @@ -27,12 +27,10 @@ , tl-expected , hunspell , gobject-introspection , glibmm_2_68 , jemalloc , rnnoise , microsoft-gsl , boost , fmt , wayland , libicns , darwin Loading @@ -48,13 +46,13 @@ let in stdenv.mkDerivation rec { pname = "kotatogram-desktop"; version = "0-unstable-2024-07-01"; version = "0-unstable-2024-09-01"; src = fetchFromGitHub { owner = "kotatogram"; repo = "kotatogram-desktop"; rev = "fbb22ebd3e39dfa4a036fa79a7a3f78b86b1cea2"; hash = "sha256-ccfmaqapk9ct+5kvBI02xHJ7YCGmm1CcqwM+3hC1bk0="; rev = "e30c1857bf38c354467f4e6a2a37b1252b4e28e6"; hash = "sha256-kmJeqaDAVKhMWwcazy+gGB+55Kao67RJrlLvZQ+AtqY="; fetchSubmodules = true; }; Loading Loading @@ -115,9 +113,7 @@ stdenv.mkDerivation rec { alsa-lib libpulseaudio hunspell glibmm_2_68 jemalloc fmt wayland ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk_11_0.frameworks; [ Cocoa Loading pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/macos.patch +121 −2 Original line number Diff line number Diff line diff --git a/Telegram/SourceFiles/platform/mac/overlay_widget_mac.mm b/Telegram/SourceFiles/platform/mac/overlay_widget_mac.mm index ef544803e9..69c61b3139 100644 --- a/Telegram/SourceFiles/platform/mac/overlay_widget_mac.mm +++ b/Telegram/SourceFiles/platform/mac/overlay_widget_mac.mm @@ -97,9 +97,11 @@ void MacOverlayWidgetHelper::updateStyles(bool fullscreen) { [window setTitleVisibility:NSWindowTitleHidden]; [window setTitlebarAppearsTransparent:YES]; [window setStyleMask:[window styleMask] | NSWindowStyleMaskFullSizeContentView]; +#if 0 if (@available(macOS 12.0, *)) { _data->topNotchSkip = [[window screen] safeAreaInsets].top; } +#endif } void MacOverlayWidgetHelper::refreshButtons(bool fullscreen) { Submodule Telegram/lib_base contains modified content diff --git a/Telegram/lib_base/base/platform/mac/base_battery_saving_mac.mm b/Telegram/lib_base/base/platform/mac/base_battery_saving_mac.mm index 7ce90d3..dac3c2c 100644 Loading Loading @@ -33,14 +49,88 @@ index 7ce90d3..dac3c2c 100644 const auto state = DetectBatteryState(); if (!state.has || !state.draining) { return false; Submodule Telegram/lib_webrtc contains modified content diff --git a/Telegram/lib_webrtc/webrtc/platform/mac/webrtc_environment_mac.mm b/Telegram/lib_webrtc/webrtc/platform/mac/webrtc_environment_mac.mm index 7521c08..5e22da2 100644 --- a/Telegram/lib_webrtc/webrtc/platform/mac/webrtc_environment_mac.mm +++ b/Telegram/lib_webrtc/webrtc/platform/mac/webrtc_environment_mac.mm @@ -364,6 +364,7 @@ EnvironmentMac::EnvironmentMac(not_null<EnvironmentDelegate*> delegate) DefaultCaptureDeviceChangedMonitor.registerEnvironment(this); AudioDeviceListChangedMonitor.registerEnvironment(this); +#if 0 if (@available(macOS 14.0, *)) { const auto weak = base::make_weak(this); id block = [^(BOOL shouldBeMuted){ @@ -387,6 +388,7 @@ EnvironmentMac::EnvironmentMac(not_null<EnvironmentDelegate*> delegate) setInputMuteStateChangeHandler:block error:nil]; } +#endif } EnvironmentMac::~EnvironmentMac() { @@ -537,15 +539,18 @@ void EnvironmentMac::devicesRequested(DeviceType type) { } void EnvironmentMac::setCaptureMuted(bool muted) { +#if 0 if (@available(macOS 14.0, *)) { if (!_captureMuteNotification) { const auto value = muted ? YES : NO; [[AVAudioApplication sharedInstance] setInputMuted:value error:nil]; } } +#endif } void EnvironmentMac::captureMuteSubscribe() { +#if 0 if (@available(macOS 14.0, *)) { id observer = [[InputMuteObserver alloc] init]; [[[NSWorkspace sharedWorkspace] notificationCenter] @@ -578,6 +583,7 @@ void EnvironmentMac::captureMuteSubscribe() { [observer release]; }); } +#endif } void EnvironmentMac::captureMuteUnsubscribe() { @@ -595,6 +601,7 @@ void EnvironmentMac::captureMuteRestartAdm() { void EnvironmentMac::setCaptureMuteTracker( not_null<CaptureMuteTracker*> tracker, bool track) { +#if 0 if (@available(macOS 14.0, *)) { if (track) { if (!_captureMuteTracker) { @@ -619,6 +626,7 @@ void EnvironmentMac::setCaptureMuteTracker( } } } +#endif } std::unique_ptr<Environment> CreateEnvironment( Submodule Telegram/lib_webview contains modified content diff --git a/Telegram/lib_webview/webview/platform/mac/webview_mac.mm b/Telegram/lib_webview/webview/platform/mac/webview_mac.mm index 657c5a4..4bfc097 100644 index e7808fc..34020f0 100644 --- a/Telegram/lib_webview/webview/platform/mac/webview_mac.mm +++ b/Telegram/lib_webview/webview/platform/mac/webview_mac.mm @@ -317,9 +317,11 @@ Instance::Instance(Config config) { @@ -334,6 +334,7 @@ Instance::Instance(Config config) { _handler = [[Handler alloc] initWithMessageHandler:config.messageHandler navigationStartHandler:config.navigationStartHandler navigationDoneHandler:config.navigationDoneHandler dialogHandler:config.dialogHandler dataRequested:handleDataRequest]; _dataRequestHandler = std::move(config.dataRequestHandler); [configuration setURLSchemeHandler:_handler forURLScheme:stdToNS(kDataUrlScheme)]; +#if 0 if (@available(macOS 14, *)) { if (config.userDataToken != LegacyStorageIdToken().toStdString()) { NSUUID *uuid = UuidFromToken(config.userDataToken); @@ -341,10 +342,13 @@ Instance::Instance(Config config) { [uuid release]; } } +#endif _webview = [[WKWebView alloc] initWithFrame:NSZeroRect configuration:configuration]; +#if 0 if (@available(macOS 13.3, *)) { Loading @@ -50,3 +140,32 @@ index 657c5a4..4bfc097 100644 [_manager addScriptMessageHandler:_handler name:@"external"]; [_webview setNavigationDelegate:_handler]; [_webview setUIDelegate:_handler]; @@ -700,10 +704,12 @@ void *Instance::winId() { } void Instance::setOpaqueBg(QColor opaqueBg) { +#if 0 if (@available(macOS 12.0, *)) { [_webview setValue: @NO forKey: @"drawsBackground"]; [_webview setUnderPageBackgroundColor:[NSColor clearColor]]; } +#endif } void Instance::resizeToWindow() { @@ -739,6 +745,7 @@ std::string GenerateStorageToken() { } void ClearStorageDataByToken(const std::string &token) { +#if 0 if (@available(macOS 14, *)) { if (!token.empty() && token != LegacyStorageIdToken().toStdString()) { if (NSUUID *uuid = UuidFromToken(token)) { @@ -754,6 +761,7 @@ void ClearStorageDataByToken(const std::string &token) { } } } +#endif } } // namespace Webview Loading
pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/default.nix +3 −7 Original line number Diff line number Diff line Loading @@ -27,12 +27,10 @@ , tl-expected , hunspell , gobject-introspection , glibmm_2_68 , jemalloc , rnnoise , microsoft-gsl , boost , fmt , wayland , libicns , darwin Loading @@ -48,13 +46,13 @@ let in stdenv.mkDerivation rec { pname = "kotatogram-desktop"; version = "0-unstable-2024-07-01"; version = "0-unstable-2024-09-01"; src = fetchFromGitHub { owner = "kotatogram"; repo = "kotatogram-desktop"; rev = "fbb22ebd3e39dfa4a036fa79a7a3f78b86b1cea2"; hash = "sha256-ccfmaqapk9ct+5kvBI02xHJ7YCGmm1CcqwM+3hC1bk0="; rev = "e30c1857bf38c354467f4e6a2a37b1252b4e28e6"; hash = "sha256-kmJeqaDAVKhMWwcazy+gGB+55Kao67RJrlLvZQ+AtqY="; fetchSubmodules = true; }; Loading Loading @@ -115,9 +113,7 @@ stdenv.mkDerivation rec { alsa-lib libpulseaudio hunspell glibmm_2_68 jemalloc fmt wayland ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk_11_0.frameworks; [ Cocoa Loading
pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/macos.patch +121 −2 Original line number Diff line number Diff line diff --git a/Telegram/SourceFiles/platform/mac/overlay_widget_mac.mm b/Telegram/SourceFiles/platform/mac/overlay_widget_mac.mm index ef544803e9..69c61b3139 100644 --- a/Telegram/SourceFiles/platform/mac/overlay_widget_mac.mm +++ b/Telegram/SourceFiles/platform/mac/overlay_widget_mac.mm @@ -97,9 +97,11 @@ void MacOverlayWidgetHelper::updateStyles(bool fullscreen) { [window setTitleVisibility:NSWindowTitleHidden]; [window setTitlebarAppearsTransparent:YES]; [window setStyleMask:[window styleMask] | NSWindowStyleMaskFullSizeContentView]; +#if 0 if (@available(macOS 12.0, *)) { _data->topNotchSkip = [[window screen] safeAreaInsets].top; } +#endif } void MacOverlayWidgetHelper::refreshButtons(bool fullscreen) { Submodule Telegram/lib_base contains modified content diff --git a/Telegram/lib_base/base/platform/mac/base_battery_saving_mac.mm b/Telegram/lib_base/base/platform/mac/base_battery_saving_mac.mm index 7ce90d3..dac3c2c 100644 Loading Loading @@ -33,14 +49,88 @@ index 7ce90d3..dac3c2c 100644 const auto state = DetectBatteryState(); if (!state.has || !state.draining) { return false; Submodule Telegram/lib_webrtc contains modified content diff --git a/Telegram/lib_webrtc/webrtc/platform/mac/webrtc_environment_mac.mm b/Telegram/lib_webrtc/webrtc/platform/mac/webrtc_environment_mac.mm index 7521c08..5e22da2 100644 --- a/Telegram/lib_webrtc/webrtc/platform/mac/webrtc_environment_mac.mm +++ b/Telegram/lib_webrtc/webrtc/platform/mac/webrtc_environment_mac.mm @@ -364,6 +364,7 @@ EnvironmentMac::EnvironmentMac(not_null<EnvironmentDelegate*> delegate) DefaultCaptureDeviceChangedMonitor.registerEnvironment(this); AudioDeviceListChangedMonitor.registerEnvironment(this); +#if 0 if (@available(macOS 14.0, *)) { const auto weak = base::make_weak(this); id block = [^(BOOL shouldBeMuted){ @@ -387,6 +388,7 @@ EnvironmentMac::EnvironmentMac(not_null<EnvironmentDelegate*> delegate) setInputMuteStateChangeHandler:block error:nil]; } +#endif } EnvironmentMac::~EnvironmentMac() { @@ -537,15 +539,18 @@ void EnvironmentMac::devicesRequested(DeviceType type) { } void EnvironmentMac::setCaptureMuted(bool muted) { +#if 0 if (@available(macOS 14.0, *)) { if (!_captureMuteNotification) { const auto value = muted ? YES : NO; [[AVAudioApplication sharedInstance] setInputMuted:value error:nil]; } } +#endif } void EnvironmentMac::captureMuteSubscribe() { +#if 0 if (@available(macOS 14.0, *)) { id observer = [[InputMuteObserver alloc] init]; [[[NSWorkspace sharedWorkspace] notificationCenter] @@ -578,6 +583,7 @@ void EnvironmentMac::captureMuteSubscribe() { [observer release]; }); } +#endif } void EnvironmentMac::captureMuteUnsubscribe() { @@ -595,6 +601,7 @@ void EnvironmentMac::captureMuteRestartAdm() { void EnvironmentMac::setCaptureMuteTracker( not_null<CaptureMuteTracker*> tracker, bool track) { +#if 0 if (@available(macOS 14.0, *)) { if (track) { if (!_captureMuteTracker) { @@ -619,6 +626,7 @@ void EnvironmentMac::setCaptureMuteTracker( } } } +#endif } std::unique_ptr<Environment> CreateEnvironment( Submodule Telegram/lib_webview contains modified content diff --git a/Telegram/lib_webview/webview/platform/mac/webview_mac.mm b/Telegram/lib_webview/webview/platform/mac/webview_mac.mm index 657c5a4..4bfc097 100644 index e7808fc..34020f0 100644 --- a/Telegram/lib_webview/webview/platform/mac/webview_mac.mm +++ b/Telegram/lib_webview/webview/platform/mac/webview_mac.mm @@ -317,9 +317,11 @@ Instance::Instance(Config config) { @@ -334,6 +334,7 @@ Instance::Instance(Config config) { _handler = [[Handler alloc] initWithMessageHandler:config.messageHandler navigationStartHandler:config.navigationStartHandler navigationDoneHandler:config.navigationDoneHandler dialogHandler:config.dialogHandler dataRequested:handleDataRequest]; _dataRequestHandler = std::move(config.dataRequestHandler); [configuration setURLSchemeHandler:_handler forURLScheme:stdToNS(kDataUrlScheme)]; +#if 0 if (@available(macOS 14, *)) { if (config.userDataToken != LegacyStorageIdToken().toStdString()) { NSUUID *uuid = UuidFromToken(config.userDataToken); @@ -341,10 +342,13 @@ Instance::Instance(Config config) { [uuid release]; } } +#endif _webview = [[WKWebView alloc] initWithFrame:NSZeroRect configuration:configuration]; +#if 0 if (@available(macOS 13.3, *)) { Loading @@ -50,3 +140,32 @@ index 657c5a4..4bfc097 100644 [_manager addScriptMessageHandler:_handler name:@"external"]; [_webview setNavigationDelegate:_handler]; [_webview setUIDelegate:_handler]; @@ -700,10 +704,12 @@ void *Instance::winId() { } void Instance::setOpaqueBg(QColor opaqueBg) { +#if 0 if (@available(macOS 12.0, *)) { [_webview setValue: @NO forKey: @"drawsBackground"]; [_webview setUnderPageBackgroundColor:[NSColor clearColor]]; } +#endif } void Instance::resizeToWindow() { @@ -739,6 +745,7 @@ std::string GenerateStorageToken() { } void ClearStorageDataByToken(const std::string &token) { +#if 0 if (@available(macOS 14, *)) { if (!token.empty() && token != LegacyStorageIdToken().toStdString()) { if (NSUUID *uuid = UuidFromToken(token)) { @@ -754,6 +761,7 @@ void ClearStorageDataByToken(const std::string &token) { } } } +#endif } } // namespace Webview