git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] git-gui: bring Wish process to front on Mac
@ 2013-06-06  8:17 Stefan Haller
  2013-06-06 14:09 ` Pat Thoyts
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Haller @ 2013-06-06  8:17 UTC (permalink / raw)
  To: Pat Thoyts; +Cc: git

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@haller-berlin.de>
---
 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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-06-15 23:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-06  8:17 [PATCH] git-gui: bring Wish process to front on Mac Stefan Haller
2013-06-06 14:09 ` Pat Thoyts
2013-06-06 17:12   ` Stefan Haller
2013-06-07 21:56     ` [PATCH v2] " Stefan Haller
2013-06-14 17:54       ` Junio C Hamano
2013-06-15 23:07         ` Pat Thoyts
2013-06-06 18:15   ` [PATCH] " Junio C Hamano
2013-06-07 21:58     ` Stefan Haller

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).