Thread (6 messages) flat view 6 messages, 2 authors, 2021-08-04
STALE1848d

[PATCH 1/3] gitk: skip calling osascript to set frontmost for tk >= 8.6

From: Carlo Marcelo Arenas Belón <hidden>
Date: 2021-08-04 01:09:29
Subsystem: the rest · Maintainer: Linus Torvalds

76bf6ff (gitk: On OSX, bring the gitk window to front, 2013-04-24) adds
an osascript to set the gitk window to the front to workaround and
unfortunate default in older tk versions to add it to the back.

tk 8.6 or newer do not need that workaround so add a conditional check
to skip it and while at it update the comment with the new name for the
OS.

Signed-off-by: Carlo Marcelo Arenas Belón <redacted>
---
 gitk | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/gitk b/gitk
index 23d9dd1..f68d983 100755
--- a/gitk
+++ b/gitk
@@ -12288,13 +12288,15 @@ if {[catch {package require Tk 8.4} err]} {
     exit 1
 }
 
-# on OSX bring the current Wish process window to front
+# on macOS bring the current Wish process window to front if needed
 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] ]
+    if {$tcl_version < 8.6} {
+        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
-- 
2.33.0.rc0.433.g9a510e7e11
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help