[Pythonmac-SIG] Should Python.app be an LSUIElement = 1 app?

Bill Janssen janssen at parc.com
Mon Feb 2 22:22:49 CET 2009


Ned Deily <nad at acm.org> wrote:

> In article <73365.1233593908 at parc.com>, Bill Janssen <janssen at parc.com> 
> wrote:
> 
> > I'm thinking that the right thing to do about rocket-in-the-dock should
> > be to change the Info.plist of Python.app, to include the setting
> > "LSUIElement: 1".
> 
> There's also LSBackgroundOnly.  That might be even more appropriate.  
> But OTOH ...

Yes, I'm thinking that, too.  I'm running my system Python with that
set, and it seems to fix my various problems.

For others following along, here's the pointer to the Apple docs:
http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/PListKeys.html

> ... setting it does have the side effect of making IDLE's menus 
> disappear when launched from the command line (bin/idle).  (Launching 
> via IDLE.app is unaffected.)

Fascinating.  But I don't think that's fatal -- shouldn't users be using
IDLE.app?

> It also has the effect of removing the 
> default Tcl/Tk-supplied menu bar for Tkinter programs; try running the 
> turtleDemo, for instance.  Those programs lose Copy/Paste/Cut and the 
> Quit, though the app does quit if you click the red window close button.  
> Perhaps tkinter can call TPT.

Indeed.  Given that there's already a "#ifdef TK_AQUA" section in
Modules/_tkinter.c:init_tkinter(), I'd think that would be a fine place
to put a call to TransformProcessType.  That would probably make IDLE's
menus reappear when launched from the command-line, too.

> I'm poking in that area at the moment and will be submitting a number of 
> patches for 3.x and 2.x real soon now.  I'll try to whip something up in 
> the next few days and report back.

I'll review them.

> One thing the background settings doesn't seem to change is the 
> regression test (subprocess) that brings up the Application Failed 
> dialog.  But I haven't had time to look at that one in detail yet.
> 
> Have you tried this with appscript?

Yes.  My appscript scanning app is working fine with LSBackgroundOnly set,
and no rocket in the dock.  I can logout, the various Python processes are
terminated fine.

Bill


More information about the Pythonmac-SIG mailing list