about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/networking/instant-messengers/telegram/telegram-desktop/macos.patch
blob: c8424359fdbfd76796f2215369f45f40e17fbf43 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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
--- a/Telegram/lib_base/base/platform/mac/base_battery_saving_mac.mm
+++ b/Telegram/lib_base/base/platform/mac/base_battery_saving_mac.mm
@@ -138,6 +138,7 @@ BatterySaving::BatterySaving(Fn<void()> changedCallback) {
 	_observer = [[LowPowerModeObserver alloc] initWithCallback:std::move(wrapped)];
 
 	NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
+#if 0
 	if (@available(macOS 12.0, *)) {
 		[center
 			addObserver: _observer
@@ -145,6 +146,7 @@ BatterySaving::BatterySaving(Fn<void()> changedCallback) {
 			name: NSProcessInfoPowerStateDidChangeNotification
 			object: nil];
 	}
+#endif
 	[center
 		addObserver: _observer
 		selector: @selector(powerStateChanged:)
@@ -178,11 +180,13 @@ std::optional<bool> BatterySaving::enabled() const {
 		return std::nullopt;
 	}
 	NSProcessInfo *info = [NSProcessInfo processInfo];
+#if 0
 	if (@available(macOS 12.0, *)) {
 		if ([info isLowPowerModeEnabled]) {
 			return true;
 		}
 	}
+#endif
 	const auto state = DetectBatteryState();
 	if (!state.has || !state.draining) {
 		return false;
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 738e574..80ff5f0 100644
--- a/Telegram/lib_webview/webview/platform/mac/webview_mac.mm
+++ b/Telegram/lib_webview/webview/platform/mac/webview_mac.mm
@@ -254,10 +254,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() {