git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tair Sabirgaliev <tair.sabirgaliev@bee.kz>
To: git@vger.kernel.org
Cc: paulus@samba.org
Subject: Re: [PATCH] gitk: workaround Tcl/Tk Cmd-TAB behavior on OSX
Date: Thu, 11 Apr 2013 01:12:48 +0600	[thread overview]
Message-ID: <5165B9B0.8060301@bee.kz> (raw)
In-Reply-To: <5165B758.4070308@bee.kz>

The prev message was garbled :( Here is the correct patch (I hope).

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

  reply	other threads:[~2013-04-10 19:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-10 19:02 [PATCH] gitk: workaround Tcl/Tk Cmd-TAB behavior on OSX Tair Sabirgaliev
2013-04-10 19:12 ` Tair Sabirgaliev [this message]
     [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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5165B9B0.8060301@bee.kz \
    --to=tair.sabirgaliev@bee.kz \
    --cc=git@vger.kernel.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).