[GRLUG] X overlay drawing app?

Michael Mol mikemol at gmail.com
Mon Apr 19 14:47:10 EDT 2010


On Mon, Apr 19, 2010 at 2:27 PM, Adam Tauno Williams
<awilliam at whitemice.org> wrote:
> On Mon, 2010-04-19 at 13:58 -0400, Michael Mol wrote:
>> Tricky to do, particularly with compositing window managers. I can
>> only think of three ways an app writer would do it:
>> 1) Create a full screen window with backing store, draw the
>> annotations on top of it, and find a way to get X to refresh the
>> backing store periodically. (Will lead to either massive CPU overhead,
>> or the appearance of a very laggy system) Avoid capturing any input.
>> (I don't know enough to know how they'd do that part.)
>> 2) Create a full screen window with an RGBA color space. (I don't even
>> know if X even supports this. It would require some compositing tricks
>> I'm not sure current compositing window managers do.) Avoid capturing
>> input. (I again don't know how to do that part.)
>> 3) Create a *huge* number of windows, for each apparent block blit to
>> the screen; this would be incredibly hackish and wasteful, but *might*
>> work. If you can't avoid capturing the input, it would have the odd
>> side-effect of "erasing" underlying controls and buttons. Might make
>> an interesting prank app, that way.
>> If such an app does exist, I'd definitely be interested in poking at
>> it and seeing how it works!
>
> It would probably be easier to intercept an RFB stream from the X VNC
> module and compose an overlay on that [the RFB protocol is really
> simple, relatively speaking].  You'd probably have to anotate your
> screen in a window displaying a scaled image of your screen.

Email needs a *likes* button.

The really nice thing about this approach is that it collapses the X
server's viewport to a flat surface, which is ultimately *much* easier
to draw on. Heck, going this route, you could simply put the overlay
and annotations as part of a VNC client.

The biggest downside is managing multimon, but I'm getting a strong
sense that X drivers and apps just aren't integrating well.

(offtopic rant)
Even common core apps like Firefox and GNOME have difficulty with
cross-screen communication in non-Xinerama setups, and the advanced
features of both NVidia's and ATI's cards are unavailable in Xinerama
setups. Yay. I've also gotten cynical enough that I don't even want to
bother filing bug reports against such issues, because I'll just get
filed away as an unimportant edge case scenario. (The app devs will
say, "Use Xinerama", and the driver devs will say, "Don't use
Xinerama"--actually, NVidia already gave Xinerama in their proprietary
driver the middle finger a while back, long before they announced
ceasing support of the open-source "nv" driver.)
(/rant)

-- 
:wq


More information about the grlug mailing list