summaryrefslogtreecommitdiff
path: root/gitk
diff options
context:
space:
mode:
authorTair Sabirgaliev <tair.sabirgaliev@bee.kz>2013-04-24 09:48:27 (GMT)
committerPaul Mackerras <paulus@samba.org>2013-05-13 11:29:43 (GMT)
commit76bf6ff93e1766b8813f0cdbe9089080010ba646 (patch)
treee196bb624c7203bea86dff3d497dc6f3709d2007 /gitk
parentc33cb9083ecad2ec7e23b00722096a94e62b17e1 (diff)
downloadgit-76bf6ff93e1766b8813f0cdbe9089080010ba646.zip
git-76bf6ff93e1766b8813f0cdbe9089080010ba646.tar.gz
git-76bf6ff93e1766b8813f0cdbe9089080010ba646.tar.bz2
gitk: On OSX, bring the gitk window to front
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>
Diffstat (limited to 'gitk')
-rwxr-xr-xgitk9
1 files changed, 9 insertions, 0 deletions
diff --git a/gitk b/gitk
index 22a05b0..5cd00d8 100755
--- a/gitk
+++ b/gitk
@@ -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)