summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorculler <culler>2021-04-30 13:14:48 (GMT)
committerculler <culler>2021-04-30 13:14:48 (GMT)
commit671154ccc5c0ce1f8249c44583bca497ea860b84 (patch)
treef47e0f002b089d396443b957a68aecc510b68e79 /macosx
parenta723a9e97cc86c5cbee7c26aca2d344ad18c12a1 (diff)
downloadtk-671154ccc5c0ce1f8249c44583bca497ea860b84.zip
tk-671154ccc5c0ce1f8249c44583bca497ea860b84.tar.gz
tk-671154ccc5c0ce1f8249c44583bca497ea860b84.tar.bz2
Do not process idle events before withdrawing a window.
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tkMacOSXWm.c12
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) {