diff options
author | culler <culler> | 2021-04-28 15:56:54 (GMT) |
---|---|---|
committer | culler <culler> | 2021-04-28 15:56:54 (GMT) |
commit | 5b49b83abd433f95230651b236e7882871f1b995 (patch) | |
tree | 30cef07b1f3ad169234aad3f1b9193770257ba62 | |
parent | 2ce4830f8b177a13e360b787bba7b2b73adb8183 (diff) | |
parent | 4d1967bac73880c706d9c1c5b11388e97a695faa (diff) | |
download | tk-5b49b83abd433f95230651b236e7882871f1b995.zip tk-5b49b83abd433f95230651b236e7882871f1b995.tar.gz tk-5b49b83abd433f95230651b236e7882871f1b995.tar.bz2 |
Merge CALayer-86
-rw-r--r-- | macosx/tkMacOSXWm.c | 9 | ||||
-rw-r--r-- | tests/bind.test | 5 | ||||
-rw-r--r-- | tests/ttk/spinbox.test | 10 | ||||
-rw-r--r-- | tests/ttk/validate.test | 33 |
4 files changed, 41 insertions, 16 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 7a40135..164b00c 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -6433,6 +6433,12 @@ TkpWmSetState( macWin = TkMacOSXGetNSWindowForDrawable(winPtr->window); + /* + * Make sure windows are updated before the state change. + */ + + while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {}; + if (state == WithdrawnState) { Tk_UnmapWindow((Tk_Window)winPtr); } else if (state == IconicState) { @@ -6453,8 +6459,9 @@ TkpWmSetState( [macWin orderFront:NSApp]; TkMacOSXZoomToplevel(macWin, state == NormalState ? inZoomIn : inZoomOut); } + /* - * Make sure windows are updated after the state change. + * Make sure windows are updated after the state change too. */ while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)){} diff --git a/tests/bind.test b/tests/bind.test index cd07b09..58d5799 100644 --- a/tests/bind.test +++ b/tests/bind.test @@ -1047,6 +1047,7 @@ test bind-13.45 {Tk_BindEvent procedure: error in script} -setup { test bind-15.1 {MatchPatterns procedure, ignoring type mismatches} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f + update idletasks focus -force .t.f update } -body { @@ -1063,6 +1064,7 @@ test bind-15.1 {MatchPatterns procedure, ignoring type mismatches} -setup { test bind-15.2 {MatchPatterns procedure, ignoring type mismatches} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f + update idletasks focus -force .t.f update } -body { @@ -1474,6 +1476,7 @@ test bind-15.26 {MatchPatterns procedure, reject a virtual event} -setup { test bind-15.27 {MatchPatterns procedure, conflict resolution} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f + update idletasks focus -force .t.f update } -body { @@ -1488,6 +1491,7 @@ test bind-15.27 {MatchPatterns procedure, conflict resolution} -setup { test bind-15.28 {MatchPatterns procedure, conflict resolution} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f + update idletasks focus -force .t.f update } -body { @@ -1502,6 +1506,7 @@ test bind-15.28 {MatchPatterns procedure, conflict resolution} -setup { test bind-15.29 {MatchPatterns procedure, conflict resolution} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f + update idletasks focus -force .t.f update } -body { diff --git a/tests/ttk/spinbox.test b/tests/ttk/spinbox.test index abd2a0f..e2b91f6 100644 --- a/tests/ttk/spinbox.test +++ b/tests/ttk/spinbox.test @@ -138,14 +138,18 @@ test spinbox-1.8.3 "option -validate" -setup { } -returnCodes error -result {bad validate "bogus": must be all, key, focus, focusin, focusout, or none} test spinbox-1.8.4 "-validate option: " -setup { - set ::spinbox_test {} ttk::spinbox .sb -from 0 -to 100 + set ::spinbox_test {} } -body { - .sb configure -validate all -validatecommand {lappend ::spinbox_test %P} + .sb configure -validate all -validatecommand {set ::spinbox_test %P} pack .sb + update idletasks .sb set 50 focus -force .sb - after 500 {set ::spinbox_wait 1} ; vwait ::spinbox_wait + set ::spinbox_wait 0 + set timer [after 100 {set ::spinbox_wait 1}] + vwait ::spinbox_wait + after cancel $timer set ::spinbox_test } -cleanup { destroy .sb diff --git a/tests/ttk/validate.test b/tests/ttk/validate.test index 8b48d2a..90b09f7 100644 --- a/tests/ttk/validate.test +++ b/tests/ttk/validate.test @@ -78,54 +78,63 @@ test validate-1.7 {entry widget validation - vmode focus} -body { } -result {} test validate-1.8 {entry widget validation - vmode focus} -body { + set ::vVals {} + set timer [after 300 lappend ::vVals timeout] focus -force .e - # update necessary to process FocusIn event - update + vwait ::vVals + after cancel $timer set ::vVals } -result {.e -1 -1 abcd abcd {} focus focusin} test validate-1.9 {entry widget validation - vmode focus} -body { + set ::vVals {} + set timer [after 300 lappend ::vVals timeout] focus -force . - # update necessary to process FocusOut event - update + vwait ::vVals + after cancel $timer set ::vVals } -result {.e -1 -1 abcd abcd {} focus focusout} .e configure -validate all test validate-1.10 {entry widget validation - vmode all} -body { + set ::vVals {} + set timer [after 300 lappend ::vVals timeout] focus -force .e - # update necessary to process FocusIn event - update + vwait ::vVals + after cancel $timer set ::vVals } -result {.e -1 -1 abcd abcd {} all focusin} test validate-1.11 {entry widget validation} -body { + set ::vVals {} + set timer [after 300 lappend ::vVals timeout] focus -force . - # update necessary to process FocusOut event - update + vwait ::vVals + after cancel $timer set ::vVals } -result {.e -1 -1 abcd abcd {} all focusout} .e configure -validate focusin test validate-1.12 {entry widget validation} -body { + set ::vVals {} + set timer [after 300 lappend ::vVals timeout] focus -force .e - # update necessary to process FocusIn event - update + vwait ::vVals + after cancel $timer set ::vVals } -result {.e -1 -1 abcd abcd {} focusin focusin} test validate-1.13 {entry widget validation} -body { set ::vVals {} focus -force . - # update necessary to process FocusOut event update set ::vVals } -result {} .e configure -validate focuso test validate-1.14 {entry widget validation} -body { + set ::vVals {} focus -force .e - # update necessary to process FocusIn event update set ::vVals } -result {} |