Drawing on the full screen of X Window
There are several ways to draw strokes on the full screen of X Window,
- Using the SHAPE extension, while it's very time consuming to calculate the bitmask when you draw complex curves. Not sure if libxosd works better.
- Using Composite overlay window, looks like a wonderful solution, but it maybe occupied by a compositing manager (like Compiz), so your painting might be corrupted when compiz redrawing a window. While you could still create a "always-on-top" window for compositing, which requires a window manager supports freedesktop's standards, refer to libaosd.
- Creating an off-screen pixmap for root window and painting on that, then using
XCopyArea(3X11)to copy the result image to root with a "full-screen" GC (whoseGCSubwindowModeisIncludeInferiors). If you want some funcy effects, use RENDER extension to create aPicturefor root (with the attributesubwindow_modeasIncludeInferiors), then composite on it. The performance is good, and has no side-effects when working with a compositing manager.
To get the global mouse event, you could use XEVIE, though currently it may report some warnings like "Xlib: sequence lost (...) in reply type 0x6!", when catching pointer events. However it does not support multiple clients. A better option probably is to use RECORD extension. And last, using XGrabPointer(3X11) in some circumstances (like the right button is pressed for a while) to grab the mouse, so that the mouse movement would not affect the running apps on the screen.
P.S., as Alan pointed out in the comments, "You should not rely on XEvIE - it hasn't been maintained in several years, and has been removed by the X.Org community in the upcoming Xorg server 1.6 release."


You should not rely on XEvIE - it hasn't been maintained in several years, and has been removed by the X.Org community in the upcoming Xorg server 1.6 release.
发表于 Alan Coopersmith 在 2008年12月05日, 02:18 上午 CST #
Alan, thanks so much for the info!
发表于 Yong Sun 在 2008年12月05日, 09:05 上午 CST #
Hi Yong:
Would you tell me where can get the latest Sun Pinyin for Mac OS X Leopard? Shall I compile source code or just install( dmg file)?
Thanks,
Peter
发表于 peter 在 2008年12月05日, 03:49 下午 CST #
Hi, Peter, I would encourage you to build it by yourself, refer to http://opensolaris.org/os/project/input-method/documents/building_sunpinyin. Or, you could download the pkg at http://blogs.sun.com/yongsun/resource/sunpinyin-mac-leopard.pkg.zip, and then download the large slm and lexicon binary files, refer to http://blogs.sun.com/yongsun/entry/sunpinyin_for_mac_leopard_updated.
发表于 Yong Sun 在 2008年12月05日, 04:42 下午 CST #
Thanks, but your first link doesn't work:
"
Resource Not Found
We're sorry. The resource "/os/project/input-method/documents/building_sunpinyin." could not be found. Please check the URL for proper spelling and capitalization. If you're having trouble locating a page on this site, try visiting the OpenSolaris home page.
"
发表于 peter 在 2008年12月06日, 01:30 下午 CST #
It should be,
http://opensolaris.org/os/project/input-method/documents/building_sunpinyin
Just delete the last "."
发表于 Jeffrey 在 2008年12月06日, 03:02 下午 CST #