summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorculler <culler>2018-11-20 19:44:11 (GMT)
committerculler <culler>2018-11-20 19:44:11 (GMT)
commit05b49a9826205148598325c51b795d782dac0481 (patch)
treeb6aca82e17cb7f94bdf0cd5ec3770884ad6e2610 /macosx
parent804b2865d43d53651eda82e4698ac6e44ee0af37 (diff)
parent13f6c367a6b4413a8ae0bdda8eb77bf1c98534d7 (diff)
downloadtk-05b49a9826205148598325c51b795d782dac0481.zip
tk-05b49a9826205148598325c51b795d782dac0481.tar.gz
tk-05b49a9826205148598325c51b795d782dac0481.tar.bz2
Fix the bug that caused a crash on macOS when switching to the Alt theme.
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tkMacOSXEvent.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/macosx/tkMacOSXEvent.c b/macosx/tkMacOSXEvent.c
index 843ef8c..d866b02 100644
--- a/macosx/tkMacOSXEvent.c
+++ b/macosx/tkMacOSXEvent.c
@@ -137,13 +137,22 @@ MODULE_SCOPE void
TkMacOSXFlushWindows(void)
{
NSArray *macWindows = [NSApp orderedWindows];
+
if ([macWindows count] > 0) {
while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)){}
}
- for (NSWindow *w in macWindows) {
- if (TkMacOSXGetXWindow(w)) {
- [w displayIfNeeded];
- }
+ if ([NSApp isDrawing]) {
+ for (NSWindow *w in macWindows) {
+ if (TkMacOSXGetXWindow(w)) {
+ [w setViewsNeedDisplay:YES];
+ }
+ }
+ } else {
+ for (NSWindow *w in macWindows) {
+ if (TkMacOSXGetXWindow(w)) {
+ [w display];
+ }
+ }
}
}