Check-in [2904e9d0f1]
Not logged in

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

Overview
Comment:add tk upstream changes
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2904e9d0f14c22846149f1f927cc4b9c66c7af24
User & Date: chw 2019-10-12 06:16:46
Context
2019-10-12
06:20
update sqlite to version 3.30.1 check-in: dd476ccce4 user: chw tags: trunk
06:16
add tk upstream changes check-in: 2904e9d0f1 user: chw tags: trunk
2019-10-11
19:18
more tk upstream changes check-in: c9c48cbf65 user: chw tags: trunk
Changes

Changes to jni/sdl2tk/macosx/tkMacOSXMouseEvent.c.

54
55
56
57
58
59
60

61
62
63
64
65
66
67
...
652
653
654
655
656
657
658

659
660
661
662
663
664
665
    TkWindow *winPtr = NULL, *grabWinPtr;
    Tk_Window tkwin;
    NSPoint local, global;
#if 0
    NSTrackingArea *trackingArea = nil;
    NSInteger eventNumber, clickCount, buttonNumber;
#endif


#ifdef TK_MAC_DEBUG_EVENTS
    TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, theEvent);
#endif
    switch (eventType) {
    case NSMouseEntered:
    case NSMouseExited:
................................................................................
void
TkpSetCapture(
    TkWindow *winPtr)		/* Capture window, or NULL. */
{
    while (winPtr && !Tk_IsTopLevel(winPtr)) {
	winPtr = winPtr->parentPtr;
    }

    captureWinPtr = (Tk_Window) winPtr;
}
 
/*
 *----------------------------------------------------------------------
 *
 * TkMacOSXGetCapture --







>







 







>







54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
...
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
    TkWindow *winPtr = NULL, *grabWinPtr;
    Tk_Window tkwin;
    NSPoint local, global;
#if 0
    NSTrackingArea *trackingArea = nil;
    NSInteger eventNumber, clickCount, buttonNumber;
#endif
    [NSEvent stopPeriodicEvents];

#ifdef TK_MAC_DEBUG_EVENTS
    TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, theEvent);
#endif
    switch (eventType) {
    case NSMouseEntered:
    case NSMouseExited:
................................................................................
void
TkpSetCapture(
    TkWindow *winPtr)		/* Capture window, or NULL. */
{
    while (winPtr && !Tk_IsTopLevel(winPtr)) {
	winPtr = winPtr->parentPtr;
    }
    [NSEvent stopPeriodicEvents];
    captureWinPtr = (Tk_Window) winPtr;
}
 
/*
 *----------------------------------------------------------------------
 *
 * TkMacOSXGetCapture --

Changes to jni/sdl2tk/macosx/tkMacOSXNotify.c.

307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324

325
326
327
328
329
330
331
	        [NSApp nextEventMatchingMask:NSAnyEventMask
			untilDate:[NSDate distantPast]
			inMode:GetRunLoopMode(TkMacOSXGetModalSession())
			dequeue:NO];
	if (currentEvent) {
	    if (currentEvent.type > 0) {
		Tcl_SetMaxBlockTime(&zeroBlockTime);
		if (havePeriodicEvents) {
		    [NSEvent stopPeriodicEvents];
		    havePeriodicEvents = NO;
		}
	    }
	} else if (!havePeriodicEvents){

	    /*
	     * When the user is not generating events we schedule a "hearbeat"
	     * event to fire every 0.1 seconds.  This helps to make the vwait
	     * command more responsive when there is no user input.

	     */

	    havePeriodicEvents = YES;
	    [NSEvent startPeriodicEventsAfterDelay:0.0 withPeriod:0.1];
	}
    }
}







<
|
|
<






|
>







307
308
309
310
311
312
313

314
315

316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
	        [NSApp nextEventMatchingMask:NSAnyEventMask
			untilDate:[NSDate distantPast]
			inMode:GetRunLoopMode(TkMacOSXGetModalSession())
			dequeue:NO];
	if (currentEvent) {
	    if (currentEvent.type > 0) {
		Tcl_SetMaxBlockTime(&zeroBlockTime);

		[NSEvent stopPeriodicEvents];
		havePeriodicEvents = NO;

	    }
	} else if (!havePeriodicEvents){

	    /*
	     * When the user is not generating events we schedule a "hearbeat"
	     * event to fire every 0.1 seconds.  This helps to make the vwait
	     * command more responsive when there is no user input, e.g. when
	     * running the test suite.
	     */

	    havePeriodicEvents = YES;
	    [NSEvent startPeriodicEventsAfterDelay:0.0 withPeriod:0.1];
	}
    }
}

Changes to jni/sdl2tk/tests/canvImg.test.

162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
...
737
738
739
740
741
742
743

744
745

746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761

762
763

764
765
766
767
768
769
770
771
...
795
796
797
798
799
800
801
802
803
804
805
806

807
808

809
810
811
812
813
814
815
816
    image create test foo -variable x
    image create test foo2 -variable y
    foo2 changed 0 0 0 0 80 60
    .c create image 50 100 -image foo -tags i1 -anchor nw
    update
    set x {}
    set y {}
    set timer [after 300 {lappend y "timeout"}]
    .c itemconfigure i1 -image foo2
    update idletasks
    update
    # On MacOS we need to wait for the test image display procedure to run.
    while {"timeout" ni $y && [lindex $y end 1] ne "display"} {
        vwait y
    }
    after cancel timer
    list $x $y [.c bbox i1]
} -cleanup {
	.c delete all
	image delete foo
................................................................................
    .c delete all
    update
} -body {
    image create test foo -variable x
    .c create image 50 100 -image foo -tags image -anchor nw
    update
    set x {}

    foo changed 2 4 6 8 30 15
    # macOS Catalina needs a delay here.

    after 20
    update
    return $x
} -cleanup {
	.c delete all
	image delete foo
} -result $result_10_1

test canvImg-11.1 {TranslateImage procedure} -constraints testImageType -setup {
    .c delete all
    update
} -body {
	image create test foo -variable x
    .c create image 50 100 -image foo -tags image -anchor nw
    update
    set x {}

    foo changed 2 4 6 8 40 50
    # macOS Catalina needs a delay here.

    after 20
    update
    return $x
} -cleanup {
	.c delete all
	image delete foo
} -result {{foo display 0 0 40 50}}
test canvImg-11.2 {ImageChangedProc procedure} -constraints {
................................................................................
    .c delete all
    update
} -body {
    image create test foo -variable x
    image create test foo2 -variable y
    foo changed 0 0 0 0 40 50
    foo2 changed 0 0 0 0 80 60

    .c create image 50 100 -image foo -tags image -anchor nw
    .c create image 70 110 -image foo2 -anchor nw
    update
    set y {}

    image create test foo -variable x
    # macOS Catalina needs a delay here.

    after 20
    update
    return $y
} -cleanup {
	.c delete all
	image delete foo foo2
} -result $result_11_3








|




|







 







>

<
>
|











|



>

<
>
|







 







<




>

<
>
|







162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
...
737
738
739
740
741
742
743
744
745

746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764

765
766
767
768
769
770
771
772
773
...
797
798
799
800
801
802
803

804
805
806
807
808
809

810
811
812
813
814
815
816
817
818
    image create test foo -variable x
    image create test foo2 -variable y
    foo2 changed 0 0 0 0 80 60
    .c create image 50 100 -image foo -tags i1 -anchor nw
    update
    set x {}
    set y {}
    set timer [after 300 {lappend y "timed out"}]
    .c itemconfigure i1 -image foo2
    update idletasks
    update
    # On MacOS we need to wait for the test image display procedure to run.
    while {"timed out" ni $y && [lindex $y end 1] ne "display"} {
        vwait y
    }
    after cancel timer
    list $x $y [.c bbox i1]
} -cleanup {
	.c delete all
	image delete foo
................................................................................
    .c delete all
    update
} -body {
    image create test foo -variable x
    .c create image 50 100 -image foo -tags image -anchor nw
    update
    set x {}
    set timer [after 500 {lappend x "timed out"}]
    foo changed 2 4 6 8 30 15

    vwait x
    after cancel $timer
    update
    return $x
} -cleanup {
	.c delete all
	image delete foo
} -result $result_10_1

test canvImg-11.1 {TranslateImage procedure} -constraints testImageType -setup {
    .c delete all
    update
} -body {
    image create test foo -variable x
    .c create image 50 100 -image foo -tags image -anchor nw
    update
    set x {}
    set timer [after 500 {lappend x "timed out"}]
    foo changed 2 4 6 8 40 50

    vwait x
    after cancel $timer
    update
    return $x
} -cleanup {
	.c delete all
	image delete foo
} -result {{foo display 0 0 40 50}}
test canvImg-11.2 {ImageChangedProc procedure} -constraints {
................................................................................
    .c delete all
    update
} -body {
    image create test foo -variable x
    image create test foo2 -variable y
    foo changed 0 0 0 0 40 50
    foo2 changed 0 0 0 0 80 60

    .c create image 50 100 -image foo -tags image -anchor nw
    .c create image 70 110 -image foo2 -anchor nw
    update
    set y {}
    set timer [after 500 {lappend y "timed out"}]
    image create test foo -variable x

    vwait x
    after cancel $timer
    update
    return $y
} -cleanup {
	.c delete all
	image delete foo foo2
} -result $result_11_3