Sugar Factory

From OLPC
Revision as of 00:08, 21 February 2010 by Alsroot (talk | contribs) (Fix broken git link)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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