Tk Source Code

Check-in [364c9099]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix bug [d1989fb7cf]: In Aqua the root window appears before Tk_Mainloop is called.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-6-branch
Files: files | file ages | folders
SHA3-256: 364c9099aa2cee1791657409c5f1fdb06361a0e534c60b055a911853a5d50ec5
User & Date: culler 2019-05-16 19:54:40
Context
2019-05-17
07:21
Add missing INT2PTR (doesn't cause warning with Tcl8.x, but does with Tcl 9.0). One None -> NULL change which was still missing. Backported from trunk. check-in: 777211ed user: jan.nijtmans tags: core-8-6-branch
2019-05-16
19:55
Fix bug [d1989fb7cf]: In Aqua the root window appears before Tk_Mainloop is called. check-in: a2e1c6c6 user: culler tags: trunk
19:54
Fix bug [d1989fb7cf]: In Aqua the root window appears before Tk_Mainloop is called. check-in: 364c9099 user: culler tags: core-8-6-branch
13:03
In Aqua, draw dark mode menubuttons as inactive, as is done for buttons. This makes them imperfect, but usable. This is the best we can do as long as HITheme is used for drawing. For correct appearance use ttk::menubutton. check-in: 256af6d0 user: culler tags: core-8-6-branch
2019-05-15
16:55
fix bug [d1989fb7cf]: Root window appears before Tk_Mainloop is called. Closed-Leaf check-in: 9e9a9189 user: culler tags: bug-d1989fb7cf
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to macosx/tkMacOSXInit.c.

   321    321   				   [NSNumber numberWithInt:-1],
   322    322   			      @"NSStringDrawingTypesetterBehavior",
   323    323   			      nil]];
   324    324   	[TKApplication sharedApplication];
   325    325   	[pool drain];
   326    326   	[NSApp _setup:interp];
   327    327   	[NSApp finishLaunching];
          328  +	Tk_MacOSXSetupTkNotifier();
          329  +
          330  +	/*
          331  +	 * If the root window is mapped before the App has finished launching
          332  +	 * it will open off screen (see ticket 56a1823c73).  To avoid this we
          333  +	 * ask Tk to process an event with no wait.  We expect Tcl_DoOneEvent
          334  +	 * to wait until the Mac event loop has been created and then return
          335  +	 * immediately since the queue is empty.
          336  +	 */
          337  +
          338  +	Tcl_DoOneEvent(TCL_WINDOW_EVENTS| TCL_DONT_WAIT);
   328    339   
   329    340   	/*
   330    341   	 * If we don't have a TTY and stdin is a special character file of
   331    342   	 * length 0, (e.g. /dev/null, which is what Finder sets when double
   332    343   	 * clicking Wish) then use the Tk based console interpreter.
   333    344   	 */
   334    345   
................................................................................
   357    368   	    if (Tk_CreateConsoleWindow(interp) == TCL_ERROR) {
   358    369   		return TCL_ERROR;
   359    370   	    }
   360    371   	}
   361    372   
   362    373       }
   363    374   
   364         -    Tk_MacOSXSetupTkNotifier();
   365         -
   366    375       if (tkLibPath[0] != '\0') {
   367    376   	Tcl_SetVar2(interp, "tk_library", NULL, tkLibPath, TCL_GLOBAL_ONLY);
   368    377       }
   369    378   
   370    379       if (scriptPath[0] != '\0') {
   371    380   	Tcl_SetVar2(interp, "auto_path", NULL, scriptPath,
   372    381   		TCL_GLOBAL_ONLY|TCL_LIST_ELEMENT|TCL_APPEND_VALUE);
................................................................................
   373    382       }
   374    383   
   375    384       Tcl_CreateObjCommand(interp, "::tk::mac::standardAboutPanel",
   376    385   	    TkMacOSXStandardAboutPanelObjCmd, NULL, NULL);
   377    386       Tcl_CreateObjCommand(interp, "::tk::mac::iconBitmap",
   378    387   	    TkMacOSXIconBitmapObjCmd, NULL, NULL);
   379    388   
   380         -    /*
   381         -     * Workaround for 3efbe4a397; console not accepting keyboard input on 10.14
   382         -     * if displayed before main window. This places console in background and it
   383         -     * accepts input after being raised.
   384         -     */
   385         -
   386         -    while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {}
   387         -
   388    389       return TCL_OK;
   389    390   }
   390    391   
   391    392   /*
   392    393    *----------------------------------------------------------------------
   393    394    *
   394    395    * TkpGetAppName --

Changes to macosx/tkMacOSXSubwindows.c.

   164    164   	    [NSApp activateIgnoringOtherApps:NO];
   165    165   	    [[win contentView] setNeedsDisplay:YES];
   166    166   	    if ([win canBecomeKeyWindow]) {
   167    167   		[win makeKeyAndOrderFront:NSApp];
   168    168   	    } else {
   169    169   		[win orderFrontRegardless];
   170    170   	    }
   171         -
   172         -	    /*
   173         -	     * In some cases the toplevel will not be drawn unless we process
   174         -	     * all pending events now.  See ticket 56a1823c73.
   175         -	     */
   176         -
   177         -	    [NSApp _lockAutoreleasePool];
   178         -	    while (Tcl_DoOneEvent(TCL_WINDOW_EVENTS| TCL_DONT_WAIT)) {}
   179         -	    [NSApp _unlockAutoreleasePool];
   180    171   	} else {
   181    172   	    TkWindow *contWinPtr = TkpGetOtherWindow(winPtr);
   182    173   
   183    174   	    /*
   184    175   	     * Rebuild the container's clipping region and display
   185    176   	     * the window.
   186    177   	     */