summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tkBind.c19
-rw-r--r--tests/bind.test4
-rw-r--r--tests/event.test33
3 files changed, 4 insertions, 52 deletions
diff --git a/generic/tkBind.c b/generic/tkBind.c
index 8f91ff3..ae9d5e1 100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.c
@@ -2231,14 +2231,8 @@ Tk_BindEvent(
curEvent = bindPtr->eventInfo + eventPtr->type;
/*
- * Ignore the event completely if it is an Enter, Leave, FocusIn, or
- * FocusOut event with detail NotifyInferior. The reason for ignoring
- * these events is that we don't want transitions between a window and its
- * children to be visible to bindings on the parent: this would cause
- * problems for mega-widgets, since the internal structure of a
- * mega-widget isn't supposed to be visible to people watching the parent.
- *
- * Furthermore we have to compute current time, needed for "event generate".
+ * Compute current time needed for "event generate",
+ * and reset counters for Key and Button events.
*/
switch (eventPtr->type) {
@@ -2248,15 +2242,6 @@ Tk_BindEvent(
bindInfoPtr->lastCurrentTime = CurrentTimeInMilliSecs();
bindInfoPtr->lastEventTime = eventPtr->xcrossing.time;
}
- if (eventPtr->xcrossing.detail == NotifyInferior) {
- return;
- }
- break;
- case FocusIn:
- case FocusOut:
- if (eventPtr->xfocus.detail == NotifyInferior) {
- return;
- }
break;
case KeyPress:
case KeyRelease: {
diff --git a/tests/bind.test b/tests/bind.test
index b899097..a99876d 100644
--- a/tests/bind.test
+++ b/tests/bind.test
@@ -574,7 +574,7 @@ test bind-13.9 {Tk_BindEvent procedure} -setup {
} -cleanup {
destroy .t.f
} -result {{.t.f z (.t.f <Button-1> binding)} {.t.f z (.t.f <Button> binding)}}
-test bind-13.10 {Tk_BindEvent procedure: ignore NotifyInferior} -setup {
+test bind-13.10 {Tk_BindEvent procedure: don't ignore NotifyInferior - bug 47d4f29159} -setup {
frame .t.f -class Test -width 150 -height 100
pack .t.f
focus -force .t.f
@@ -590,7 +590,7 @@ test bind-13.10 {Tk_BindEvent procedure: ignore NotifyInferior} -setup {
return $x
} -cleanup {
destroy .t.f
-} -result {Enter100 Leave102}
+} -result {Enter100 Enter101 Leave102 Leave103}
test bind-13.11 {Tk_BindEvent procedure: collapse Motions} -setup {
frame .t.f -class Test -width 150 -height 100
pack .t.f
diff --git a/tests/event.test b/tests/event.test
index 1eb23c0..c56d4d8 100644
--- a/tests/event.test
+++ b/tests/event.test
@@ -815,39 +815,6 @@ test event-8 {event generate with keysyms corresponding to
deleteWindows
} -result {OK}
-test event-9 {no <Enter> event is generated for the container window when its
- managed window in which the mouse pointer was inside gets
- destroyed - bug 9e1312f32c} -setup {
- set res [list ]
- set iconified false
- if {[winfo ismapped .]} {
- wm iconify .
- update
- set iconified true
- }
-} -body {
- toplevel .top
- pack propagate .top 0
- bind .top <Enter> {lappend res %W}
- pack [frame .top.f -bg green -width 50 -height 50] -anchor se -side bottom
- tkwait visibility .top.f
- after 50
- update
- focus -force .top.f
- event generate .top.f <Motion> -warp 1 -x 25 -y 25 ; # <Enter> sent to .top and .top.f
- controlPointerWarpTiming
- update ; # idletasks not enough
- destroy .top.f ; # no <Enter> event sent
- update
- set res
-} -cleanup {
- deleteWindows
- if {$iconified} {
- wm deiconify .
- update
- }
-} -result {.top .top.f}
-
test event-9.1 {enter . window by destroying a toplevel - bug b1d115fa60} -setup {
set EnterBind [bind . <Enter>]
} -body {