On Feb 10, 2008, at 16:30, John Koren wrote:
> Jeremy
>
> Now this is really minor issue. Just to amplify what was implied
> below. in
> analogy to all other Mac OS X applications it seems to me that
> command
>>> open -a X11<< in Terminal should bring X11 to the front if it is
>>> already
> running. As I mentioned below, >>/usr/bin/osascript -e 'tell
> application
> "/Applications/Utilities/X11.app'<< will do it but not >>open -a
> X11<<.
> -John
>
> On Feb 10, 2008 3:08 PM, John Koren <
email@hidden> wrote:
>
>> Yes, exactly, the problem is when X11 is already running. And yes, '
>>
http://trac.macosforge.org/projects/xquartz/ticket/43' seems to be
>> cover
>> the same issue. We discussed this issue a while back and perhaps
>> this ticket
>> is a result of that discussion.
>> A small correction. I incorrectly stated below that the wrapper
>> needs to
>> be launched from the Finder's toolbar for the problem to manifest
>> itself.
>> The problem exits also when the script is double-clicked inside a
>> Finder
>> window.
>>
>> -John
>>
>>
>> On Feb 10, 2008 2:38 PM, Jeremy Huddleston <
email@hidden>
>> wrote:
>>
>>> Ok, so if I understand you correctly, this is _just_ with
>>> launching an
>>> application when X11 is already running. When X11 isn't running, it
>>> should properly claim focus. It looks like you're explaining
>>>
http://trac.macosforge.org/projects/xquartz/ticket/43
>>> , but I thought you were just talking about when X11 started.
>>>
>>> --Jeremy
>>>
>>> On Feb 10, 2008, at 14:30, John Koren wrote:
>>>
>>>> Jeremy
>>>>
>>>> No it is still a problem for me. Let me give you more detail.
>>>> First of all, the problem occurs only if the wrapper script
>>>> created by
>>>> Platypus is placed into the Finder's toolbar.
>>>>
>>>> Here are two simple shell scripts starting xterm. (My real script
>>>> has
>>>> directory path set so the xterm opens in the directory I want).
>>>>
>>>> 1)
>>>> #! /bin/sh
>>>> # start_xterm1.sh
>>>>
>>>> /usr/X11/bin/xterm &
>>>>
>>>> # end start_xterm1.sh
>>>>
>>>> 2)
>>>> #! /bin/sh
>>>> # start_xterm2.sh
>>>>
>>>> /usr/X11/bin/xterm & # call 1
>>>>
>>>> #*** bring X11 to the front ***
>>>> sleep 1
>>>> /usr/bin/osascript -e 'tell application "/Applications/Utilities/
>>>> X11.app" to
>>>> activate' # call 2
>>>>
>>>> # end start_xterm2.sh
>>>>
>>>> The first script (start_xterm1.sh), after being wrapped in Platypus
>>>> and
>>>> placed in the Finder's tool bar, will start xterm but the Finder
>>>> window will
>>>> stay in the foreground. In detail, xterm opens on the top but as
>>>> the
>>>> script
>>>> exits it jumps back behind the Finder window.
>>>>
>>>> The second script will keep the xterm on the top. 'sleep 1' is
>>>> needed
>>>> because without it sometimes two xterms would open because of the
>>>> race
>>>> condition between call 1 and call 2 on the initial launch of X11.
>>>>
>>>> I should also make a correction to my earlier statement that
>>>> 'open -
>>>> a X11'
>>>> would also bring X11 to the front. In fact it does not but the
>>>> osascript
>>>> does.
>>>>
>>>> What seems to be happening is that when xterm is launched it does
>>>> does not
>>>> let the OS know that it belongs with X11 and therefore after the
>>>> script
>>>> start_xterm1.sh terminates Finder takes over again. One needs to
>>>> activate
>>>> X11 explicitly.
>>>>
>>>> Cheers -John
>>>>
>>>> PS. Jeremy, I can send you the corresponding Platypus wrappers if
>>>> needed.
>>>>
>>>>
>>>>
>>>>
>>>> On Feb 10, 2008 2:07 AM, Jeremy Huddleston
>>>> <
email@hidden> wrote:
>>>>
>>>>>> No you are not the only one. I have open -a X11 in my bundled
>>>>>> scripts mainly
>>>>>> to bring X11 to the front since some X11 windows (e.g. rxvt)
>>>>>> stay
>>>>>> behind
>>>>>> Finder windows when launched from Finder.
>>>>>
>>>>> That should not be the case as of 2.1.2 (maybe even 2.1.1, but I'm
>>>>> not
>>>>> sure about that)
>>>
>>>
>>