git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gitk: workaround Tcl/Tk Cmd-TAB behavior on OSX
@ 2013-04-10 19:02 Tair Sabirgaliev
  2013-04-10 19:12 ` Tair Sabirgaliev
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Tair Sabirgaliev @ 2013-04-10 19:02 UTC (permalink / raw)
  To: git; +Cc: paulus

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 trivial: if we are on OSX, emulate Cmd-Shift-TAB
key event, so that the gitk application window is brought
from bottom to top.

Signed-off-by: Tair Sabirgaliev <tair.sabirgaliev@gmail.com>
---
  gitk | 13 +++++++++++++
  1 file changed, 13 insertions(+)

diff --git a/gitk b/gitk
index 572f73f..60a87fc 100755
--- a/gitk
+++ b/gitk
@@ -11687,6 +11687,19 @@ if {[catch {package require Tk 8.4} err]} {
      exit 1
  }
  +# On OSX workaround the Tcl/Tk windows going down the stack of Cmd-TAB
+if {[tk windowingsystem] eq "aqua"} {
+    exec osascript -e {
+        tell application "System Events"
+            key down command
+            key down shift
+            keystroke tab
+            key up shift
+            key up command
+        end tell    +    }
+}
+
  # Unset GIT_TRACE var if set
  if { [info exists ::env(GIT_TRACE)] } {
      unset ::env(GIT_TRACE)
-- 
1.8.2

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

end of thread, other threads:[~2013-04-24  9:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-10 19:02 [PATCH] gitk: workaround Tcl/Tk Cmd-TAB behavior on OSX Tair Sabirgaliev
2013-04-10 19:12 ` Tair Sabirgaliev
     [not found] ` <CAJDDKr76K_-d6JSgv67DcXnZybpxkTjYPJxdObU3wrn+nYV3dw@mail.gmail.com>
2013-04-11  4:36   ` Tair Sabirgaliev
2013-04-20  3:19 ` Paul Mackerras
2013-04-20 10:45   ` Tair Sabirgaliev
2013-04-23 13:26 ` Stefan Haller
2013-04-24  9:48   ` [PATCH 1] gitk: on OSX bring the gitk window to front Tair Sabirgaliev

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 NNTP newsgroup(s).