threads / patch / 25742

patchgitk: Make text selectable on Mac

Subject: [PATCH] gitk: Make text selectable on Mac

## tl;dr

2 messages between Nov 14, 2010 and Dec 12, 2010. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Stefan Haller· Nov 14, 2010, 12:22 UTC · lore
From: Stefan Haller <stefan@haller-berlin.de>

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>
---
 gitk |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Show changes to gitk +1 −0
diff --git a/gitk b/gitk
index 45e3380..14ffde2 100755
--- a/gitk
+++ b/gitk
@@ -2453,6 +2453,7 @@ proc makewindow {} {
     global ctxbut
     bind $cflist $ctxbut {pop_flist_menu %W %X %Y %x %y}
     bind $ctext $ctxbut {pop_diff_menu %W %X %Y %x %y}
+    bind $ctext <Button-1> {focus %W}
 
     set maincursor [. cget -cursor]
     set textcursor [$ctext cget -cursor]
-- 
1.7.3.2.154.gcfae0
Paul Mackerras· Dec 12, 2010, 04:27 UTC · re: Stefan Haller · lore

Re: [PATCH] gitk: Make text selectable on Mac

On Sun, Nov 14, 2010 at 01:22:56PM +0100, Stefan Haller wrote:
> From: Stefan Haller <stefan@haller-berlin.de>
> 
> Stolen from git-gui, 23effa79f7 (original log message by
> Shawn O. Pearce <spearce@spearce.org> follows):
Thanks, applied.
Paul.

← back to recent threads