summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2016-04-05 16:08:33 (GMT)
committerfvogel <fvogelnew1@free.fr>2016-04-05 16:08:33 (GMT)
commit1e91aa73ce7aa59b5950e2a91443fdcdcba6ccaf (patch)
tree019b76b42c1b15258092aa338f1bf27a33da046f
parent0970af5f4951894b38cb6e9dcc6b64cdb7e4a41a (diff)
downloadtk-bug_fd3a4dc111.zip
tk-bug_fd3a4dc111.tar.gz
tk-bug_fd3a4dc111.tar.bz2
Fixed [fd3a4dc111] - <<Modified>> event is not always sent to peersbug_fd3a4dc111
-rw-r--r--generic/tkText.c5
-rw-r--r--tests/text.test15
2 files changed, 19 insertions, 1 deletions
diff --git a/generic/tkText.c b/generic/tkText.c
index 506075d..e6cb96d 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -5215,7 +5215,10 @@ TextEditCmd(
*/
if ((!oldModified) != (!setModified)) {
- GenerateModifiedEvent(textPtr);
+ for (textPtr = textPtr->sharedTextPtr->peers; textPtr != NULL;
+ textPtr = textPtr->next) {
+ GenerateModifiedEvent(textPtr);
+ }
}
break;
case EDIT_REDO:
diff --git a/tests/text.test b/tests/text.test
index ff933a8..03b5ae3 100644
--- a/tests/text.test
+++ b/tests/text.test
@@ -6321,6 +6321,21 @@ test text-27.14 {<<Modified>> virtual event - delete before Modified} -body {
} -cleanup {
destroy .t
} -result {thing special}
+test text-27.14a {<<Modified>> virtual event - propagation to peers} -body {
+# Bug [fd3a4dc111], <<Modified>> event is not always sent to peers
+ set ::retval 0
+ text .t -undo 1
+ .t peer create .tt
+ pack .t .tt
+ bind .t <<Modified>> {incr ::retval}
+ bind .tt <<Modified>> {incr ::retval}
+ .t insert end "This increments ::retval once for each peer, i.e. twice."
+ .t edit modified 0 ; # shall increment twice as well, not just once
+ update idletasks
+ set ::retval
+} -cleanup {
+ destroy .t .tt
+} -result {4}
test text-27.15 {<<Selection>> virtual event} -body {
set ::retval no_selection
pack [text .t -undo 1]