[PATCH] gitk: Enable selected patch text on Windows
On windows, mouse input follows the keyboard focus, so to allow selecting text from the patch canvas we must not shift focus back to the top level. This change has no negative impact on X, so we don't explicitly test for Win32 on this change. This provides similar selection capability as already available using X-Windows. Signed-off-by: Mark Levedahl <mdl123@verizon.net> Signed-off-by: Paul Mackerras <paulus@samba.org>
Mark Levedahl committed
Aug 7, 2007 at 21:40 UTC
bd441de4df68c4144425b1c18d323fd90f3f9617
1 file changed
+5
-2
gitk
+5
-2
@@ -964,8 +964,8 @@ proc bindkey {ev script} {
964
# set the focus back to the toplevel for any click outside
965
# the entry widgets
966
proc click {w} {
967
- global entries
968
- foreach e $entries {
967
+ global ctext entries
968
+ foreach e [concat $entries $ctext] {
969
if {$w == $e} return
970
}
971
focus .
@@ -4600,6 +4600,7 @@ proc sellastline {} {
4600
4601
proc selnextline {dir} {
4602
global selectedline
4603
+ focus .
4604
if {![info exists selectedline]} return
4605
set l [expr {$selectedline + $dir}]
4606
unmarkmatches
@@ -4680,6 +4681,7 @@ proc godo {elt} {
4681
4682
proc goback {} {
4683
global history historyindex
4684
+ focus .
4685
4686
if {$historyindex > 1} {
4687
incr historyindex -1
@@ -4693,6 +4695,7 @@ proc goback {} {
4695
4696
proc goforw {} {
4697
global history historyindex
4698
+ focus .
4699
4700
if {$historyindex < [llength $history]} {
4701
set cmd [lindex $history $historyindex]