git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
TSTair Sabirgaliev <tair.sabirgaliev@bee.kz>
Date
Apr 24, 2013, 09:48 UTC
Message-ID
<3EE7D8B9-5FAE-43F5-9BE3-C4AE2A75B57D@bee.kz>
In-Reply-To
<1l1scng.k9ly7ci7gjd2M%lists@haller-berlin.de>

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>
---
 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
Previous: Stefan HallerNext: Tair Sabirgaliev
Message 6 of 7 in “gitk: workaround Tcl/Tk Cmd-TAB behavior on OSX”
  1. gitk: workaround Tcl/Tk Cmd-TAB behavior on OSXTair Sabirgaliev, Apr 10, 2013
  2. Tair SabirgalievApr 10, 2013
  3. Paul MackerrasApr 20, 2013
  4. Tair SabirgalievApr 20, 2013
  5. Stefan HallerApr 23, 2013
  6. Tair SabirgalievApr 24, 2013
  7. Tair SabirgalievApr 11, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.