summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorculler <culler@noemail.net>2017-10-27 19:35:14 (GMT)
committerculler <culler@noemail.net>2017-10-27 19:35:14 (GMT)
commit0503a05d0090449d00ed09b92daefeea3d790ffd (patch)
treea5905aaab9fe90d316f585a154a855c7c2f5c28c
parent40016833d6d31b71acec8ec32701e695f218adb5 (diff)
downloadtk-0503a05d0090449d00ed09b92daefeea3d790ffd.zip
tk-0503a05d0090449d00ed09b92daefeea3d790ffd.tar.gz
tk-0503a05d0090449d00ed09b92daefeea3d790ffd.tar.bz2
Add a regression test with constraint aqua which tests that all
embedded windows in a Text get moved when scrolling. If the logic change introduced in [2148dd68] is reverted then this test fails. FossilOrigin-Name: dcae645c764c9467a653ecbfce2326796f50059936c13154f5fa80a6c44d6ee1
-rw-r--r--generic/tkTextDisp.c1
-rw-r--r--generic/tkTextWind.c6
-rw-r--r--tests/textDisp.test22
3 files changed, 29 insertions, 0 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 594495d..d2b6147 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -4148,6 +4148,7 @@ DisplayText(
numRedisplays++;
if (tkTextDebug) {
Tcl_SetVar2(interp, "tk_textRedraw", NULL, "", TCL_GLOBAL_ONLY);
+ Tcl_SetVar2(interp, "tk_textEmbWinDisplay", NULL, "", TCL_GLOBAL_ONLY);
}
/*
diff --git a/generic/tkTextWind.c b/generic/tkTextWind.c
index c9fc20f..94fbb70 100644
--- a/generic/tkTextWind.c
+++ b/generic/tkTextWind.c
@@ -1112,6 +1112,12 @@ TkTextEmbWinDisplayProc(
return;
}
+ if (tkTextDebug) {
+ /* The variable tk_textEmbWinDisplay is cleared in DisplayText. */
+ Tcl_SetVar2(textPtr->interp, "tk_textEmbWinDisplay", NULL,
+ Tk_PathName(tkwin),
+ TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT);
+ }
if ((x + chunkPtr->width) <= 0) {
/*
* The window is off-screen; just unmap it.
diff --git a/tests/textDisp.test b/tests/textDisp.test
index 216f767..5fdf8e1 100644
--- a/tests/textDisp.test
+++ b/tests/textDisp.test
@@ -948,6 +948,28 @@ test textDisp-6.9 {DisplayText, horizontal scrollbar updates} {
update
set scrollInfo
} [list 0.0 [expr {4.0/11}]]
+test textDisp-6.10 {DisplayText, redisplay embedded windows after scroll.} {aqua} {
+ .t configure -wrap char
+ .t delete 1.0 end
+ .t insert 1.0 "Line 1"
+ foreach i {2 3 4} {
+ .t insert end "\nLine $i"
+ }
+ .t insert end "\n"
+ .t window create end -create {
+ button %W.button_one -text "Button 1"}
+ .t insert end "\nLine 6\n"
+ .t window create end -create {
+ button %W.button_two -text "Button 2"}
+ .t insert end "\nLine 8\n"
+ .t window create end -create {
+ button %W.button_three -text "Button 3"}
+ update
+ .t delete 2.0 3.0
+ update
+ list $tk_textEmbWinDisplay
+} {{.t.button_one .t.button_two .t.button_three}}
+
# The following group of tests is marked non-portable because
# they result in a lot of extra redisplay under Ultrix. I don't