summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXWm.c
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2023-08-30 17:30:28 (GMT)
committerKevin Walzer <kw@codebykevin.com>2023-08-30 17:30:28 (GMT)
commit49ed94c87b0c8c723c5b22d22f3f2cbc7b418f20 (patch)
tree2ad84cbddc75a981430fd0bf64e5b4422593ae63 /macosx/tkMacOSXWm.c
parent25ed5bd4e4392128747c8032292959f98e8112ad (diff)
downloadtk-49ed94c87b0c8c723c5b22d22f3f2cbc7b418f20.zip
tk-49ed94c87b0c8c723c5b22d22f3f2cbc7b418f20.tar.gz
tk-49ed94c87b0c8c723c5b22d22f3f2cbc7b418f20.tar.bz2
Fix for ef5d3e29a4
Diffstat (limited to 'macosx/tkMacOSXWm.c')
-rw-r--r--macosx/tkMacOSXWm.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index 8b72faf..75ebdbc 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -1289,6 +1289,11 @@ TkWmDeadWindow(
[NSApp _setMainWindow:nil];
}
[deadNSWindow close];
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
+ NSUserDefaults *preferences = [NSUserDefaults standardUserDefaults];
+ [preferences removeObserver:deadNSWindow.contentView
+ forKeyPath:@"AppleHighlightColor"];
+#endif
[deadNSWindow release];
#if DEBUG_ZOMBIES > 1
@@ -6763,6 +6768,21 @@ TkMacOSXMakeRealWindowExist(
}
TKContentView *contentView = [[TKContentView alloc]
initWithFrame:NSZeroRect];
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
+ NSUserDefaults *preferences = [NSUserDefaults standardUserDefaults];
+
+ /*
+ * AppKit calls the viewDidChangeEffectiveAppearance method when the
+ * user changes the Accent Color but not when the user changes the
+ * Highlight Color. So we register to receive KVO notifications for
+ * Highlight Color as well.
+ */
+
+ [preferences addObserver:contentView
+ forKeyPath:@"AppleHighlightColor"
+ options:NSKeyValueObservingOptionNew
+ context:NULL];
+#endif
[window setContentView:contentView];
[contentView release];
[window setDelegate:NSApp];