summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tkInt.h10
-rw-r--r--tests/event.test54
-rw-r--r--tests/filebox.test19
3 files changed, 62 insertions, 21 deletions
diff --git a/generic/tkInt.h b/generic/tkInt.h
index fe8f16e..21df17d 100644
--- a/generic/tkInt.h
+++ b/generic/tkInt.h
@@ -368,8 +368,14 @@ typedef struct TkDisplay {
* by that container. */
int geomInit;
-#define TkGetContainer(tkwin) (((TkWindow *)tkwin)->maintainerPtr != NULL ? \
- ((TkWindow *)tkwin)->maintainerPtr : ((TkWindow *)tkwin)->parentPtr)
+ /*
+ * Information used by tkGrid.c, tkPack.c, tkPlace.c, tkPointer.c,
+ * and ttkMacOSXTheme.c:
+ */
+
+#define TkGetContainer(tkwin) (Tk_TopWinHierarchy((TkWindow *)tkwin) ? NULL : \
+ (((TkWindow *)tkwin)->maintainerPtr != NULL ? \
+ ((TkWindow *)tkwin)->maintainerPtr : ((TkWindow *)tkwin)->parentPtr))
/*
* Information used by tkGet.c only:
diff --git a/tests/event.test b/tests/event.test
index f0e2311..c521b25 100644
--- a/tests/event.test
+++ b/tests/event.test
@@ -892,6 +892,60 @@ test event-9 {no <Enter> event is generated for the container window when its
}
} -result {.top .top.f}
+test event-9.1 {enter . window by destroying a toplevel - bug b1d115fa60} -setup {
+ set EnterBind [bind . <Enter>]
+} -body {
+ wm geometry . 200x200+300+300
+ wm deiconify .
+ _pause 200
+ toplevel .top2 -width 200 -height 200
+ wm geometry .top2 +[expr {[winfo rootx .]+50}]+[expr {[winfo rooty .]+50}]
+ wm deiconify .top2
+ raise .top2
+ _pause 400
+ event generate .top2 <Motion> -warp 1 -x 50 -y 50
+ _pause 100
+ bind . <Enter> {lappend res %W}
+ set res [list ]
+ destroy .top2
+ _pause 200
+ set res
+} -cleanup {
+ deleteWindows
+ bind . <Enter> $EnterBind
+} -result {.}
+test event-9.2 {enter toplevel window by destroying a toplevel - bug b1d115fa60} -setup {
+ set iconified false
+ if {[winfo ismapped .]} {
+ wm iconify .
+ update
+ set iconified true
+ }
+} -body {
+ toplevel .top1
+ wm geometry .top1 200x200+300+300
+ wm deiconify .top1
+ _pause 200
+ toplevel .top2 -width 200 -height 200
+ wm geometry .top2 +[expr {[winfo rootx .top1]+50}]+[expr {[winfo rooty .top1]+50}]
+ wm deiconify .top2
+ raise .top2
+ _pause 400
+ event generate .top2 <Motion> -warp 1 -x 50 -y 50
+ _pause 100
+ bind .top1 <Enter> {lappend res %W}
+ set res [list ]
+ destroy .top2
+ _pause 200
+ set res
+} -cleanup {
+ deleteWindows ; # destroy all children of ".", this already includes .top1
+ if {$iconified} {
+ wm deiconify .
+ update
+ }
+} -result {.top1}
+
# cleanup
update
unset -nocomplain keypress_lookup
diff --git a/tests/filebox.test b/tests/filebox.test
index fdb5614..3c48846 100644
--- a/tests/filebox.test
+++ b/tests/filebox.test
@@ -74,7 +74,6 @@ proc EnterFileByKey {parent fileName fileDir} {
}
proc SendButtonPress {parent btn type} {
- global tk_strictMotif
if {$parent == "."} {
set w .__tk_filedialog
} else {
@@ -210,7 +209,6 @@ foreach mode $modes {
# set verylongstring $verylongstring$verylongstring
# set verylongstring $verylongstring$verylongstring
- set color #404040
test filebox-2.1-$mode "tk_getOpenFile command" nonUnixUserInteraction {
ToPressButton $parent cancel
tk_getOpenFile -title "Press Cancel ($verylongstring)" -parent $parent
@@ -281,9 +279,6 @@ foreach mode $modes {
catch {unset tv}
catch {unset typeName}
ToPressButton $parent ok
- if {[info exists tv]} {
- } else {
- }
set choice [tk_getOpenFile -title "Press Ok" \
-filetypes $filters($x) -parent $parent \
-initialfile $fileName -initialdir $fileDir \
@@ -337,20 +332,6 @@ foreach mode $modes {
[info commands ::tk::dialog::file::] eq ""
}]
- set parent .
-
- set verylongstring longstring:
- set verylongstring $verylongstring$verylongstring
- set verylongstring $verylongstring$verylongstring
- set verylongstring $verylongstring$verylongstring
- set verylongstring $verylongstring$verylongstring
- # set verylongstring $verylongstring$verylongstring
- # set verylongstring $verylongstring$verylongstring
- # set verylongstring $verylongstring$verylongstring
- # set verylongstring $verylongstring$verylongstring
- # set verylongstring $verylongstring$verylongstring
-
- set color #404040
test filebox-5.1-$mode "tk_getSaveFile command" nonUnixUserInteraction {
ToPressButton $parent cancel
tk_getSaveFile -title "Press Cancel ($verylongstring)" -parent $parent