Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!snorkelwacker!bloom-beacon!HARVARD.HARVARD.EDU!jimf%saber From: jimf%saber@HARVARD.HARVARD.EDU Newsgroups: comp.windows.x Subject: Re: Invisible windows (Technical Limitations of X?) Message-ID: <9003221848.AA02726@armory> Date: 22 Mar 90 18:48:47 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 47 |In particular, consider the situation where we have to produce |complicated graphics into a window. The desired effect is to have |whatever is behind the window show through (no matter where the window |is currently positioned). The proposed solutions requires one to | | Translate to the root window, draw the graphics, and undraw |them when the window moves!! Won't work if there's a repaint from a window below yours; X will clip around your "transparent" window and no update will happen, or the window will draw through your window -- destroying it -- and you'll not be told to update it. |I (admittedly, a neophyte) don't understand what the technical |difficulties are in providing this capability. There are no technical difficulties, only synchronization problems when you're using a non-retained windowing system. If X had been designed as a retained system this would be a snap, but it would require a lot more memory to run. Currently the shape extension can do what you want but it slows down a LOT if you use a complex shape or change things often. The memory problem can be partially alleviated by creating an object-oriented environment where your objects are some type of higher complexity than a pixel (eg rectangle, ellipse, whatever). You can rebuild the pixel image by redrawing the objects and all you've lost is some CPU time. This is what you end up doing with X anyway so you really don't loose anything and you simplify your applications dramatically (they don't have to remember how to redraw everything because they never see a repaint [expose] event). Once you have a retained layer, creating transparent windows is as simple as drawing from the bottom up and clipping around things as necessary. The code to do so with good efficiency is remarkably simple. I implemented a library layer which created a retained object-oriented environment under X11R2 about a year and a half ago, with excellent success in both memory requirements and performance (and portability -- a co-worker [hi Joe] ported it to SGI GL in about four hours). Hopefully someday I'll have the time to reimplement a public-domain version.... jim frost saber software jimf@saber.com