Re: [PATCH] gitk: workaround Tcl/Tk Cmd-TAB behavior on OSX

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tair Sabirgaliev <tair.sabirgaliev@xxxxxx> 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@xxxxxxxxx>
> ---
>
>   +# 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    +    }
> +}
> +

First of all, I absolutely want this behaviour.  Bringing windows up in
the background is one of the biggest usability problems of git on Mac.

However, I don't think that synthesizing the keystrokes for
Command-Shift-Tab is a good solution. It would be better to explicitly
bring our process to the front.  One way to achieve this would be:

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] ]
}

(Not sure about the formatting, I don't speak Tcl...)

Also, we need the same thing in git gui as well.

Best,
   Stefan


-- 
Stefan Haller
Berlin, Germany
http://www.haller-berlin.de/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]