Tk Source Code

Check-in [a2e1c6c6]
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 | trunk
Files: files | file ages | folders
SHA3-256: a2e1c6c6701e34f3d7c7e3bcb79a08afd6ba6172887327012d1c580d6e6e1202
User & Date: culler 2019-05-16 19:55:43
Context
2019-05-17
07:28
Merge 8.6 check-in: 701036f9 user: jan.nijtmans tags: trunk
2019-05-16
21:27
merge trunk check-in: 2eac67b2 user: dkf tags: tip-262
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:05
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: c97b4187 user: culler tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to macosx/tkMacOSXInit.c.

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