diff options
author | culler <culler> | 2018-11-20 19:44:11 (GMT) |
---|---|---|
committer | culler <culler> | 2018-11-20 19:44:11 (GMT) |
commit | 05b49a9826205148598325c51b795d782dac0481 (patch) | |
tree | b6aca82e17cb7f94bdf0cd5ec3770884ad6e2610 /macosx | |
parent | 804b2865d43d53651eda82e4698ac6e44ee0af37 (diff) | |
parent | 13f6c367a6b4413a8ae0bdda8eb77bf1c98534d7 (diff) | |
download | tk-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.c | 17 |
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]; + } + } } } |