Skip to content

Commit

Permalink
gitk: On OSX, bring the gitk window to front
Browse files Browse the repository at this point in the history
On OSX, Tcl/Tk application windows are created behind all
the applications down the stack of windows.  This is very
annoying, because once a gitk window appears, it's the
downmost window and switching to it is pain.

The patch is: if we are on OSX, use osascript to
bring the current Wish process window to front.

Signed-off-by: Tair Sabirgaliev <tair.sabirgaliev@gmail.com>
Thanks-to: Stefan Haller <lists@haller-berlin.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Tair Sabirgaliev authored and Paul Mackerras committed May 13, 2013
1 parent c33cb90 commit 76bf6ff
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions gitk
Original file line number Diff line number Diff line change
Expand Up @@ -11751,6 +11751,15 @@ if {[catch {package require Tk 8.4} err]} {
exit 1
}

# on OSX bring the current Wish process window to front
if {[tk windowingsystem] eq "aqua"} {
exec osascript -e [format {
tell application "System Events"
set frontmost of processes whose unix id is %d to true
end tell
} [pid] ]
}

# Unset GIT_TRACE var if set
if { [info exists ::env(GIT_TRACE)] } {
unset ::env(GIT_TRACE)
Expand Down

0 comments on commit 76bf6ff

Please sign in to comment.