@matheusbsbs / matheus-bagliano / commits / 4adcbea06e
Fork 0

gitk: Make text selectable on Mac

Stolen from git-gui, 23effa79f7 (original log message by Shawn O. Pearce <spearce@spearce.org> follows): git-gui: Force focus to the diff viewer on mouse click. Apparently a "feature" of Tcl/Tk on Mac OS X is that a disabled text widget cannot receive focus or receive a selection within it. This makes the diff viewer almost useless on that platform as you cannot select individual parts of the buffer. Now we force focus into the diff viewer when its clicked on with button 1. This works around the feature and allows selection to work within the viewer just like it does on other less sane systems, like Microsoft Windows. Signed-off-by: Stefan Haller <stefan@haller-berlin.de> Signed-off-by: Paul Mackerras <paulus@samba.org>

Stefan Haller committed Nov 14, 2010 at 13:22 UTC 4adcbea06eaedd9235ac879bf0c6fbaefb0442fc
1 file changed +1
gitk
+1
@@ -2477,6 +2477,7 @@ proc makewindow {} {
2477 global ctxbut
2478 bind $cflist $ctxbut {pop_flist_menu %W %X %Y %x %y}
2479 bind $ctext $ctxbut {pop_diff_menu %W %X %Y %x %y}
2480 + bind $ctext <Button-1> {focus %W}
2481
2482 set maincursor [. cget -cursor]
2483 set textcursor [$ctext cget -cursor]