Import Tk 8.6.10

This commit is contained in:
Steve Dower
2020-09-24 22:55:34 +01:00
parent 5ba5cbc9af
commit 42c69189d9
365 changed files with 24323 additions and 12832 deletions

View File

@@ -114,21 +114,16 @@ enum {
*
* This routine is a stub called by XSync, which is called during the Tk
* update command. The language specification does not require that the
* update command be synchronous but many of the tests assume that is the
* case. It is not naturally the case on macOS since many idle tasks are
* run inside of the drawRect method of a window's contentView, and that
* method will not be called until after this function returns. To make
* the tests work, we attempt to force this to be synchronous by waiting
* until drawRect has been called for each window. The mechanism we use
* for this is to have drawRect post an ApplicationDefined NSEvent on the
* AppKit event queue when it finishes drawing, and wait for it here.
* update command be synchronous but many of the tests implicitly assume
* that it is. It is definitely asynchronous on macOS since many idle
* tasks are run inside of the drawRect method of a window's contentView,
* which will not be called until after this function returns.
*
* Results:
* None.
*
* Side effects:
* Calls the drawRect method of the contentView of each visible
* window.
* Side effects: Processes all pending idle events then calls the display
* method of each visible window.
*
*----------------------------------------------------------------------
*/
@@ -136,15 +131,12 @@ enum {
MODULE_SCOPE void
TkMacOSXFlushWindows(void)
{
NSArray *macWindows = [NSApp orderedWindows];
if ([NSApp simulateDrawing]) {
[NSApp setSimulateDrawing:NO];
if (Tk_GetNumMainWindows() == 0) {
return;
}
for (NSWindow *w in macWindows) {
if (TkMacOSXGetXWindow(w)) {
[w displayIfNeeded];
}
while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)){}
for (NSWindow *w in [NSApp orderedWindows]) {
[w display];
}
}