Skip to content

Commit

Permalink
git-gui: Force focus to the diff viewer on mouse click.
Browse files Browse the repository at this point in the history
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: Shawn O. Pearce <spearce@spearce.org>
  • Loading branch information
Shawn O. Pearce committed Jan 25, 2007
1 parent b9a75e3 commit 23effa7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions git-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4472,6 +4472,7 @@ bind $ui_diff <Key-Up> {catch {%W yview scroll -1 units};break}
bind $ui_diff <Key-Down> {catch {%W yview scroll 1 units};break}
bind $ui_diff <Key-Left> {catch {%W xview scroll -1 units};break}
bind $ui_diff <Key-Right> {catch {%W xview scroll 1 units};break}
bind $ui_diff <Button-1> {focus %W}

if {!$single_commit} {
bind . <$M1B-Key-n> do_create_branch
Expand Down

0 comments on commit 23effa7

Please sign in to comment.