diff options
author | fvogel <fvogelnew1@free.fr> | 2016-04-29 09:46:18 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2016-04-29 09:46:18 (GMT) |
commit | 8949d8b37009d2dd0f9a410577f95d19d3419353 (patch) | |
tree | fa0c69ccba767519a0396be600b2216d4c4224c4 | |
parent | 6f43610172ef499ef09197cc5e0adf3582360a5c (diff) | |
parent | caca7822e575fd0943b0e41f85ffccfa37f02690 (diff) | |
download | tk-8949d8b37009d2dd0f9a410577f95d19d3419353.zip tk-8949d8b37009d2dd0f9a410577f95d19d3419353.tar.gz tk-8949d8b37009d2dd0f9a410577f95d19d3419353.tar.bz2 |
Fixed [fd3a4dc111] - <<Modified>> event is not always sent to peers
-rw-r--r-- | generic/tkText.c | 5 | ||||
-rw-r--r-- | tests/text.test | 15 |
2 files changed, 19 insertions, 1 deletions
diff --git a/generic/tkText.c b/generic/tkText.c index 8b94ab7..0a7ae37 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 0275ee8..a02074b 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] |