diff options
Diffstat (limited to 'tests/focus.test')
-rw-r--r-- | tests/focus.test | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/tests/focus.test b/tests/focus.test index 73bb9fd..7da289d 100644 --- a/tests/focus.test +++ b/tests/focus.test @@ -64,7 +64,7 @@ bind all <FocusIn> { bind all <FocusOut> { append focusInfo "out %W %d\n" } -bind all <KeyPress> { +bind all <Key> { append focusInfo "press %W %K" } focusSetup @@ -316,7 +316,7 @@ test focus-2.6 {TkFocusFilterEvent procedure, FocusIn events} -constraints { event gen [testwrapper .t] <FocusIn> -detail NotifyAncestor set focusInfo {} set x [focus] - event gen . <KeyPress-x> + event gen . <x> list $x $focusInfo } -result {.t.b1 {press .t.b1 x}} test focus-2.7 {TkFocusFilterEvent procedure, FocusOut events} -constraints { @@ -617,7 +617,7 @@ test focus-5.1 {ChangeXFocus procedure, don't take focus unless have it} -constr destroy .t bind all <FocusIn> {} bind all <FocusOut> {} -bind all <KeyPress> {} +bind all <Key> {} fixfocus @@ -730,6 +730,26 @@ test focus-6.2 {miscellaneous - embedded application in different process} -cons bind all <FocusOut> {} } -result {{.t.f2.e1 {} {focus out .t.f2.e1 NotifyNonlinear} {focus out .t.f2 NotifyNonlinearVirtual} {focus in .t.f1 NotifyNonlinear} | {focus out .t.f1 NotifyNonlinear} {focus in .t.f2 NotifyNonlinearVirtual} {focus in .t.f2.e1 NotifyNonlinear}} {{focus in . NotifyVirtual} {focus in .e1 NotifyAncestor} | {focus out .e1 NotifyAncestor} {focus out . NotifyVirtual}}} +test focus-7.1 {TkSetFocusWin procedure, unmapped windows} -setup { + # TkSetFocusWin handles the case of not yet mapped windows + # by not setting the focus on them right at the time it is + # requested, but by scheduling an event handler that will + # set the focus later once it gets mapped. The purpose of + # this test is to check that event scheduling and deletion + # work as expected (bug [08e2f8e6f0]). + toplevel .top + spinbox .top.s1 + spinbox .top.s2 + spinbox .top.s3 + grid .top.s1 .top.s2 .top.s3 +} -body { + focus -force .top.s2 + focus -force .top.s3 + update + focus +} -cleanup { + destroy .top +} -result {.top.s3} deleteWindows |