Unable to Open Inkscape-0.47pre2-2 from Finder in Snow Leopard, but Able to Open from Terminal

Bug #433281 reported by Xin Liu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Undecided
Unassigned

Bug Description

When I open Inkscape-0.47pre2-2 from the finder, the Inkscape icon appears on the dock, but the main window does not appear at all (the X11 server is running before launching Inkscape). I can right-click the dock icon and quit Inkscape normally (i.e., no "force quit"). If I left-click the dock icon, X11 is brought to the front.

When I open Inkscape from the Terminal using the command "open -a inkscape", it works fine.

I have macports-1.8 installed.

Tags: osx
Revision history for this message
su_v (suv-lp) wrote :

Any messages in Console.app (select 'All Messages' from the log file list, restart Inkscape from the finder)?

> I have macports-1.8 installed.
Do you mean you used the portfile from MacPorts to compile Inkscape r22157 <http://trac.macports.org/browser/trunk/dports/graphics/inkscape-devel/Portfile>? Then it's most likely a MacPorts issue - please consider asking on the macports-users mailing list <http://lists.macosforge.org/mailman/listinfo.cgi/macports-users>

Or do you use the precompiled package from <http://sourceforge.net/projects/inkscape/files/inkscape/0.47pre2/>?

tags: added: osx
Revision history for this message
Xin Liu (smilerliu) wrote :

I use the precompiled package.

I took a look at the console log, and here is the problem. I started X11 at login time. When I launch Inkscape in Finder, somehow Inkscape cannot detect that X11 is running, and will try to launch X11, but this launching process is blocked. I see "org.x.startx[<PID>] ." appearing in the log every second. When I look up the <PID> in the activity monitor, I see that it is a "sh". Now if I quit Inkscape from the dock, the Inkscape process will terminate, but the "sh" process persists. If I then quit X11, the background process that tries to launch X11 will be unblocked, and X11 will be launched again, and then the "org.x.startx" message will no longer appear in the log.

If I quit X11 and then launch Inkscape from Finder, Inkscape will automatically launch X11, and everything works fine. If I then quit Inkscape and launch Inkscape again, everything still works fine. But if now I quit both Inkscape and X11, launch X11 from Finder, and then launch Inkscape again, Inkscape will start the X11 launching process itself, and it will fail again.

I guess the problem lies in the part where Inkscape launches X11.

Revision history for this message
su_v (suv-lp) wrote :

Inkscape doesn't launch X11 itself anymore - it's a 'launchd' mechanism that kicks in whenever you start an application that needs X11.

to test:
1) quit X11
2) open terminal, type 'xlogo'

this should now start X11 and xlogo. The same is true for xterm, xman or GIMP - none of the applications themselves launch X11. Can you repeat the problem with any of these other X11 applications?

There is a related bug report (Leopard, Inkscape doesn't run if X11 is started as login item):
Bug #398186 in Inkscape: “inkscape 0.47pre1 won't run for osx 10.5.7 and Xquartz 2.3.2”

Revision history for this message
Xin Liu (smilerliu) wrote :

OK, this is it... If I don't set "DISPLAY=:0.0" manually, I can't start any X program if X11 is started as a login item. It must be a Snow Leopard bug.

When I reported this bug, I was able to start Inkscape from Terminal because I manually set "DISPLAY=:0.0" in .bashrc and X11 was started at login time.

Revision history for this message
su_v (suv-lp) wrote :

How do you start X11 at login time? Do you use a special shell script (~/.xinitrc.d/*) where you set $DISPLAY at login time?
You should not set $DISPLAY manually at all with Apple's X11 - otherwise you break the launch-on-demand support by 'launchd'.

 5- launchd support for X11
(Thanks to Ben Byer)

"New launch-on-demand support, courtesy of launchd. If you start a program that tries to open your X $DISPLAY, launchd will check to see if X11.app is running. If not, it will automatically start it for you.

The only situation where you should need to manually start X11.app is if you are only running remote X11 applications. So on Leopard, just run a command like xterm or start an application that needs X11, and X11 will start up automatically".

"In brief, don't run X11.app from the Dock. Or, at all, manually. Ensure that you are not explicitly setting $DISPLAY in any configuration files, verify that 'echo $DISPLAY' in Terminal.app reports something that starts with '/tmp/launchd', and then just run 'xterm &' from Terminal. This will work with any X11 client application that links with the standard libX11.dylib."
<http://forums.macosxhints.com/showthread.php?t=80171>

Revision history for this message
Xin Liu (smilerliu) wrote :

I start X11 by adding it to "Login Items" in my account setting, and I set DISPLAY in .bashrc: "export DISPLAY=:0.0".

I didn't know the launch-on-demand trick. Thanks for pointing it out to me. I just upgraded from Tiger to Snow Leopard, and if I remember correctly, on Tiger X11 has to be started explicitly...

Revision history for this message
su_v (suv-lp) wrote :

Yes - AFAIK there have been major changes in X11/XQuartz since Tiger. Helpful resources (if you are interested in details) could be
- the X11-users mailinglist: <http://lists.apple.com/mailman/listinfo/x11-users>
- the X11-users mailinglist archives: <http://lists.apple.com/archives/X11-users>
- <http://xquartz.macosforge.org>: "The XQuartz project is an open-source effort to develop a version of the X.org X Window System that runs on Mac OS X. Together with supporting libraries and applications, it forms the X11.app that Apple has shipped with OS X since version 10.5. "

I will close this report as it is an issue with the X11 configuration and not bug in Inkscape. If you don't agree please add a comment and revert the bug status.

Changed in inkscape:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.