[PATCH] git-gui: bring Wish process to front on Mac

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

 



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 76bf6ff93e.)

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.

Signed-off-by: Stefan Haller <stefan@xxxxxxxxxxxxxxxx>
---
 git-gui.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/git-gui.sh b/git-gui.sh
index e133331..c464928 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -29,6 +29,19 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA}]
 
 ######################################################################
 ##
+## On Mac, 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] ]
+}
+
+
+######################################################################
+##
 ## Tcl/Tk sanity check
 
 if {[catch {package require Tcl 8.4} err]
-- 
1.8.3.14.g33f718c

--
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]