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

Ned Deily nad at acm.org
Mon Feb 2 22:49:08 CET 2009


In article <77657.1233609769 at parc.com>, Bill Janssen <janssen at parc.com> 
wrote:
> 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/Art
> icles/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.

IDLE.app goes to some lengths to convince OS X that it is executing 
under its own app bundle even though it is running the interpreter from 
the framework Python.app executable (more execve trickery) so the 
Python.app Info.plist settings don't apply.  BTW, IDLE.app is also 
broken in 3.x but I think I have that all sorted out now.

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

Either way is supposed to work although there have been some 
discrepancies in menu behavior that I've sorted out.
 
> > 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.

Yes..
 
> > 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.

Good.  I still have a couple of regressions to understand before I'm 
ready to submit them.  My goal is to be able to more easily produce 
clean 3.x and 2.x Mac installers. 

> > 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.

Progress!

-- 
 Ned Deily,
 nad at acm.org



More information about the Pythonmac-SIG mailing list