xinit Clutter application not working

440 views Asked by At

I've built a simple test app with clutter: A stage with two ClutterText actors to display two words. It works OK when I run it from within gnome but running it from the tty (not gnome-terminal or xterm) with xinit my_app_binary I get an error:

failed to create drawable
Unable to initialize Clutter: Unable to select the newly created GLX context
Window manager error: Unable to initialize Clutter

If I run xinit gnome-terminal from the same tty everything works, gnome-terminal shows up in a black screen. That's the same I want to do with my app. Is there anything I can do to overcome this error?

All the above are tested in Linux Mint 12. After normal boot I switch to a tty (ALT-F1) and stop lightdm (sudo /etc/init.d/lightdm stop).

Thanks!

EDIT: running as root everything works, so the question is: how to run it as a regular user?

1

There are 1 answers

0
luukes On

Be sure to set the DISPLAY-var - add it in front of your command

DISPLAY=:0.0 /path/to/myapp

Sometimes this is an access-rights problem - the app should be started with the user who started the X-server

su user-started-x -c 'DISPLAY=:0.0 /path/to/myapp'