Sugar Factory: Difference between revisions

From OLPC
Jump to navigation Jump to search
(Albert Cahalan's Sugarizer)
 
(Fix broken git link)
 
Line 4: Line 4:
http://dev.laptop.org/~albert/xlogo-1.xo
http://dev.laptop.org/~albert/xlogo-1.xo


http://dev.laptop.org/git?p=users/albert/sugarize;a=summary
http://dev.laptop.org/git/users/albert/sugarize


How it works: A launcher program places Sugar's incompatible command
How it works: A launcher program places Sugar's incompatible command

Latest revision as of 00:08, 21 February 2010

I wrote a tool to make normal X programs to run under sugar. As a demo, it runs a logo program.

http://dev.laptop.org/~albert/xlogo-1.xo

http://dev.laptop.org/git/users/albert/sugarize

How it works: A launcher program places Sugar's incompatible command arguments into the environment, along with LD_PRELOAD pointing at a shared library. The launcher then starts up the program by calling execlp() with the arguments that the program actually needs. As the program is starting up, the dynamic linker

man ld.so

forces the shared library into the program. The shared library intercepts calls into libX11. From that intercepted function the shared library is able to set various Sugar-specific window properties before the app becomes visible. This lets activity switching work, gets the donut icon right, etc.

A slightly newer version is included in the Tux Paint activity.

Albert Cahalan

12/29/07