Tk Source Code

Artifact [9377e718]
Login

Artifact 9377e71802badb92c9c5dce42177b021535e1fba1e9622085e2caec82c87a624:

Attachment "revised_text_fa928fb2_2nd-patch.patch" to ticket [b68710ae] added by kjnash 2018-01-15 03:36:22.
diff -Naur patched/library/text.tcl 2nd-patch/library/text.tcl
--- patched/library/text.tcl	2018-01-13 15:35:51.092359459 +0000
+++ 2nd-patch/library/text.tcl	2018-01-15 03:16:26.184080501 +0000
@@ -230,6 +230,12 @@
     if {[%W cget -state] eq "normal"} {
 	if {[tk::TextCursorInSelection %W]} {
 	    tk::TextDelete %W sel.first sel.last
+	    # The PRIMARY selection has changed but the widget does
+	    # not generate this event.
+	    if {[%W cget -exportselection]} {
+		event generate %W <<Selection>>
+	    } else {
+	    }
 	} else {
 	    if {[%W compare end != insert+1i]} {
 		%W delete insert
@@ -1130,6 +1136,11 @@
 	if {([$w cget -state] eq "normal") && [$w cget -autoseparators]} {
 	    $w edit separator
 	}
+	# The PRIMARY selection has changed, but the widget does
+	# not generate this event.
+	if {[$w cget -state] eq "normal" && [$w cget -exportselection]} {
+	    event generate $w <<Selection>>
+	}
     }
 }