Re: [PATCH 1] gitk: on OSX bring the gitk window to front

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
Thanks-to: Stefan Haller <lists@xxxxxxxxxxxxxxxx>
---
 gitk | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gitk b/gitk
index 572f73f..66e59b1 100755
--- a/gitk
+++ b/gitk
@@ -11687,6 +11687,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)
-- 
1.8.2.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]