summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXInit.c
diff options
context:
space:
mode:
authorculler <culler>2019-05-15 16:55:50 (GMT)
committerculler <culler>2019-05-15 16:55:50 (GMT)
commitada461f65ebad984c9653f530723bd55a847e590 (patch)
treece6ae843292ef4658da580f6648719b56701fd7e /macosx/tkMacOSXInit.c
parent0be716f0f282bf6e937b7ad2a8beb171b51d1659 (diff)
downloadtk-ada461f65ebad984c9653f530723bd55a847e590.zip
tk-ada461f65ebad984c9653f530723bd55a847e590.tar.gz
tk-ada461f65ebad984c9653f530723bd55a847e590.tar.bz2
fix bug [d1989fb7cf]: Root window appears before Tk_Mainloop is called.
Diffstat (limited to 'macosx/tkMacOSXInit.c')
-rw-r--r--macosx/tkMacOSXInit.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c
index e403501..b21e95e 100644
--- a/macosx/tkMacOSXInit.c
+++ b/macosx/tkMacOSXInit.c
@@ -325,6 +325,17 @@ TkpInit(
[pool drain];
[NSApp _setup:interp];
[NSApp finishLaunching];
+ Tk_MacOSXSetupTkNotifier();
+
+ /*
+ * If the root window is mapped before the App has finished launching
+ * it will open off screen (see ticket 56a1823c73). To avoid this we
+ * ask Tk to process an event with no wait. We expect Tcl_DoOneEvent
+ * to wait until the Mac event loop has been created and then return
+ * immediately since the queue is empty.
+ */
+
+ Tcl_DoOneEvent(TCL_WINDOW_EVENTS| TCL_DONT_WAIT);
/*
* If we don't have a TTY and stdin is a special character file of
@@ -361,8 +372,6 @@ TkpInit(
}
- Tk_MacOSXSetupTkNotifier();
-
if (tkLibPath[0] != '\0') {
Tcl_SetVar2(interp, "tk_library", NULL, tkLibPath, TCL_GLOBAL_ONLY);
}
@@ -377,14 +386,6 @@ TkpInit(
Tcl_CreateObjCommand(interp, "::tk::mac::iconBitmap",
TkMacOSXIconBitmapObjCmd, NULL, NULL);
- /*
- * Workaround for 3efbe4a397; console not accepting keyboard input on 10.14
- * if displayed before main window. This places console in background and it
- * accepts input after being raised.
- */
-
- while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {}
-
return TCL_OK;
}