From: Paul Mackerras <paulus@samba.org>
To: Tair Sabirgaliev <tair.sabirgaliev@bee.kz>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] gitk: workaround Tcl/Tk Cmd-TAB behavior on OSX
Date: Sat, 20 Apr 2013 13:19:55 +1000 [thread overview]
Message-ID: <20130420031955.GA30856@iris.ozlabs.ibm.com> (raw)
In-Reply-To: <5165B758.4070308@bee.kz>
On Thu, Apr 11, 2013 at 01:02:48AM +0600, Tair Sabirgaliev wrote:
> 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 + }
> +}
Is this really the only way to do it? It seems a bit hacky to me. I
would think you should be able to use the "wm" command to achieve what
you want. I don't use Mac OS, so I don't know exactly how Tcl/Tk
behaves on it, but this page looks like it might hold some clues for
what you want to do:
http://teapot.activestate.com/package/name/windowlist/ver/1.4/arch/tcl/file.tm
Paul.
next prev parent reply other threads:[~2013-04-20 3:20 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
[not found] ` <CAJDDKr76K_-d6JSgv67DcXnZybpxkTjYPJxdObU3wrn+nYV3dw@mail.gmail.com>
2013-04-11 4:36 ` Tair Sabirgaliev
2013-04-20 3:19 ` Paul Mackerras [this message]
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=20130420031955.GA30856@iris.ozlabs.ibm.com \
--to=paulus@samba.org \
--cc=git@vger.kernel.org \
--cc=tair.sabirgaliev@bee.kz \
/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).