Skip to content

Commit

Permalink
git-gui: bring wish process to front on Mac
Browse files Browse the repository at this point in the history
On Mac OS X, any application that is started from the Terminal will open
behind all running applications; as a work-around, manually bring ourselves
to the front. (Stolen from gitk, commit 76bf6ff.)

We do this as the very first thing, so that any message boxes that might pop
up during the rest of the startup sequence are actually seen by the user.

[PT: added catch and moved down to ensure Tk has been loaded]

Signed-off-by: Stefan Haller <stefan@haller-berlin.de>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
  • Loading branch information
Stefan Haller authored and Pat Thoyts committed Jun 7, 2013
1 parent ed05e9f commit 7d2017e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions git-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,20 @@ proc strcat {args} {
::msgcat::mcload $oguimsg
unset oguimsg

######################################################################
##
## On Mac, bring the current Wish process window to front

if {[tk windowingsystem] eq "aqua"} {
catch {
exec osascript -e [format {
tell application "System Events"
set frontmost of processes whose unix id is %d to true
end tell
} [pid]]
}
}

######################################################################
##
## read only globals
Expand Down

0 comments on commit 7d2017e

Please sign in to comment.