diff options
author | culler <culler> | 2021-04-30 13:14:48 (GMT) |
---|---|---|
committer | culler <culler> | 2021-04-30 13:14:48 (GMT) |
commit | 671154ccc5c0ce1f8249c44583bca497ea860b84 (patch) | |
tree | f47e0f002b089d396443b957a68aecc510b68e79 | |
parent | a723a9e97cc86c5cbee7c26aca2d344ad18c12a1 (diff) | |
download | tk-671154ccc5c0ce1f8249c44583bca497ea860b84.zip tk-671154ccc5c0ce1f8249c44583bca497ea860b84.tar.gz tk-671154ccc5c0ce1f8249c44583bca497ea860b84.tar.bz2 |
Do not process idle events before withdrawing a window.
-rw-r--r-- | macosx/tkMacOSXWm.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index e039072..a4bc102 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -6447,9 +6447,19 @@ TkpWmSetState( macWin = TkMacOSXGetNSWindowForDrawable(winPtr->window); /* - * Make sure windows are updated before the state change. + * Make sure windows are updated before the state change. As an exception, + * do not do process idle tasks before withdrawing a window. The purpose of + * this is to support the common paradigm of immediately withdrawing the root + * window. Processing idle tasks before changing the state causes the root + * to briefly flash on the screen, which users of this paradigm find annoying. + * Not processing the events does not guarantee that the window will not appear + * but it makes it more likely. */ + if (state != WithdrawnState) { + while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {}; + } + while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {}; if (state == WithdrawnState) { |