[Pythonmac-SIG] Unclickable window when not running from shell...

Adam Augustine adama at augustinefam.org
Thu Aug 14 14:51:03 EDT 2003


Adam Augustine wrote:
> 
> 
> Glenn Andreas wrote:
> 
>> At 2:37 PM -0600 8/12/03, Adam Augustine wrote:
>>
> Hmm. The fact that the window with the UI actually displays properly, 
> but is simply unclickable, would seem to indicate that the process does 
> have access to the window server (at some level at least).
> 
> Well, I did a search on "window server" and read the postings that came 
> back. It seems that they all indicate that /any/ communication with the 
> window server should fail resulting in a "WindowServer[184]: 
> _CGXGetDisplayShmem: Unauthorized user" error. I get no such error and 
> the UI does show up. The python script is just waiting for input.
> 
> If it shouldn't be able to speak with the window server, then it 
> shouldn't get that far and there is a bug somewhere that looks like my 
> script has priviledges it shouldn't.
> 
> If it should be able to get that far, then there is something wrong that 
> it isn't able to be made active for input.
> 
> Any more ideas?
> 

Having re-read some of the postings on this list, I am thinking that 
this behavior of my app may actually be related to the python vs. 
pythonw issue since the symptoms are exactly the same, except for the 
error message (which I now suspect may be getting eaten somewhere).

In a previous posting (2003-08-07 7:30am), Ronald Oussoren says:

"Applications that use the WindowServer must be in a .app bundle, or 
must use an undocumented API. pythonw is a shell script that starts a 
pyton interpreter that is inside a .app bundle but is otherwise a normal 
interpreter."

I am wondering if I need to make my app into a .app bundle, or do 
something (beyond calling /usr/local/bin/pythonw) to convince 
WindowServer that I am calling from a .app bundle. How would that be done?

I have tried BuildApplet, and now am calling from my cups/backend script 
via:

"/path/pyla-app.app/Contents/MacOS/Python 
/path/pyla-app.app/Contents/MacOS/pyla-app -i"

But it still will not come to the foreground when clicked.

Ah, after doing a bit of 2>&1 I found the errors (which were getting 
eaten). They are the same SetFrontProcess failed,-606 errors that people 
get when running UI apps without pythonw, so this is almost certainly 
what Ronald was referring to.

How do I convince MacOS I am launching from an .app bundle?

Adam




More information about the Pythonmac-SIG mailing list