diff options
author | Kevin Walzer <kw@codebykevin.com> | 2019-08-21 02:44:02 (GMT) |
---|---|---|
committer | Kevin Walzer <kw@codebykevin.com> | 2019-08-21 02:44:02 (GMT) |
commit | 87d33346e9d88d45da43ba95853f819923a25a6f (patch) | |
tree | d7eea2749052b1114877df7b460720802ec7b6f0 /macosx | |
parent | a43842093ab379f2aec68ded26955e68d55c9c47 (diff) | |
download | tk-87d33346e9d88d45da43ba95853f819923a25a6f.zip tk-87d33346e9d88d45da43ba95853f819923a25a6f.tar.gz tk-87d33346e9d88d45da43ba95853f819923a25a6f.tar.bz2 |
Remove crash, replace with NSLog message calling for update if MacWindowStyle command does not retrieve window apperance correctly
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/README | 3 | ||||
-rw-r--r-- | macosx/tkMacOSXWm.c | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/macosx/README b/macosx/README index 7df4893..099fdaf 100644 --- a/macosx/README +++ b/macosx/README @@ -172,10 +172,11 @@ to aqua or darkaqua then the window will be displayed with the corresponding appearance independent of any preferences settings. If it is set to "auto" the appearance will be determined by the preferences. This command can be used to opt out of Dark Mode on a per-window basis. + - To determine the current appearance of a window in macOS 10.14 (Mojave) and higher, one can use the command: - tk::unsupported::MacWindowStyle isdark + tk::unsupported::MacWindowStyle isdark window? The boolean return value is true if the window is currently displayed with the dark appearance. diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 5d96677..e3047fa 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -5910,6 +5910,7 @@ WmWinAppearance( #else NSString *appearance; #endif // MAC_OS_X_VERSION_MAX_ALLOWED >= 101300 + const char *resultString = "unrecognized"; NSWindow *win = TkMacOSXDrawableWindow(winPtr->window); if (win) { @@ -5928,7 +5929,9 @@ WmWinAppearance( result = Tcl_NewStringObj(resultString, strlen(resultString)); } if (result == NULL) { - Tcl_Panic("Failed to read appearance name."); + NSLog(@"Failed to read appearance name; try calling update before setting the appearance of the window."); + return TCL_OK; + // Tcl_Panic("Failed to read appearance name."); } if (objc == 4) { int index; |