summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXWindowEvent.c
diff options
context:
space:
mode:
authormarc_culler <marc.culler@gmail.com>2020-09-07 20:00:31 (GMT)
committermarc_culler <marc.culler@gmail.com>2020-09-07 20:00:31 (GMT)
commit193191a719c6df441e292ebeba4c1946de55fd19 (patch)
tree83b7bf9cb0b129cd3d74475b3a893cdad3c4d79f /macosx/tkMacOSXWindowEvent.c
parentaa6bf77b41864232f8ca997436e72cdd6fabb32b (diff)
parent79152064c9c4eec29aea266f35af0b6b8cca7213 (diff)
downloadtk-193191a719c6df441e292ebeba4c1946de55fd19.zip
tk-193191a719c6df441e292ebeba4c1946de55fd19.tar.gz
tk-193191a719c6df441e292ebeba4c1946de55fd19.tar.bz2
Merge 8.6
Diffstat (limited to 'macosx/tkMacOSXWindowEvent.c')
-rw-r--r--macosx/tkMacOSXWindowEvent.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c
index 7a8c02e..6133f8e 100644
--- a/macosx/tkMacOSXWindowEvent.c
+++ b/macosx/tkMacOSXWindowEvent.c
@@ -211,8 +211,8 @@ extern NSString *NSWindowDidOrderOffScreenNotification;
TkWindow *winPtr = TkMacOSXGetTkWindow(window);
if (winPtr) {
TKContentView *view = [window contentView];
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
- if (@available(macOS 10.14, *)) {
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101500
+ if (@available(macOS 10.15, *)) {
[view viewDidChangeEffectiveAppearance];
}
#endif
@@ -1122,6 +1122,20 @@ static const char *const accentNames[] = {
objectAtIndex:3];
static const char *defaultColor = NULL;
+ if (effectiveAppearanceName == NSAppearanceNameAqua) {
+ TkSendVirtualEvent(tkwin, "LightAqua", NULL);
+ } else if (effectiveAppearanceName == NSAppearanceNameDarkAqua) {
+ TkSendVirtualEvent(tkwin, "DarkAqua", NULL);
+ }
+ if ([NSApp macOSVersion] < 101500) {
+
+ /*
+ * Mojave cannot handle the KVO shenanigans that we need for the
+ * highlight and accent color notifications.
+ */
+
+ return;
+ }
if (!defaultColor) {
defaultColor = [NSApp macOSVersion] < 110000 ? "Blue" : "Multicolor";
@@ -1144,11 +1158,6 @@ static const char *const accentNames[] = {
effectiveAppearanceName.UTF8String, accentName,
highlightName);
Tk_SendVirtualEvent(tkwin, "AppearanceChanged", Tcl_NewStringObj(data, -1));
- if (effectiveAppearanceName == NSAppearanceNameAqua) {
- Tk_SendVirtualEvent(tkwin, "LightAqua", NULL);
- } else if (effectiveAppearanceName == NSAppearanceNameDarkAqua) {
- Tk_SendVirtualEvent(tkwin, "DarkAqua", NULL);
- }
}
- (void)observeValueForKeyPath:(NSString *)keyPath