Re: Xshape extension
Carsten Haitzler (The Rasterman) <[email protected]>
| Newsgroups | gmane.comp.xfree86.devel |
|---|---|
| Organization | You expect me to be organized? |
| Message-ID | <[email protected]> |
On Mon, 07 Feb 2005 22:04:37 -0200 Adilson Oliveira <[email protected]> babbled: > Hello. > > I'm sorry to bring this subject again but I really could use some help here. > I'm working on an application which needs to use XShape extension to > create a window with a transparent background. So far so good, the > problem is that this mask has to be changed constantly, using the window > background as key to it. > Right now what I'm doing, is for every bitmap I need to put on the > window, I scan for the background color, create the mask, put the image > and apply the mask using XShapeCombineShape. > Should be straightforward I think, but I'm getting all sort of weird > things like the mask not doing any effect, etc. > I experimented on creating a fix mask and apply. This works very well, > the problem seens to arise when I try to manipulate the bitmap mask and > use it several times. > The documentation I found do far is very thin specialy on examples how > to use other XShape related functions like XShapeOffsetShape, > XShapeCombineMask, etc. I took a look in programs that uses it like > oclock, xteddy, etc but they don't go deep on it. > Does anyone knows a better source of documentation about XShape and it's > related fuctions in general. > Perhaps I'm messing with the bitmap mask but all the tests I made so far > indicates that it's been created correctly. > Any advice will be very apreciated. xshape in my experience works perfectly - so you can pretty much discount bugs there. the simplest way to use it is XShapeCombineMask() where you create a 1bit pixmap where 0 bits are "transparent" and 1 bits are solid - draw it, fill it then set the shape for your window. the pixmap is no longer needed after you set the mask as it is converted into a list of rectangles so you can free it. other ways are to set the rectangle list yourself with XShapeCombineRectangles() (always set the rectangle ordering to unordered to avoid bugs). you can also use the shapes of other windows and merge/combine them (if another window already has the shape you want - eg a window manager wants to use the client window's shape and COMBINE it with its own frame window shape) using XShapeCombineShape(). some of the best code u'll find inside windowmanagers to do some of this :) pick any one. enlightenment does a fair bit with shapes for example. :) other wm's should be equally good. -- ------------- Codito, ergo sum - "I code, therefore I am" -------------- The Rasterman (Carsten Haitzler) [email protected] [email protected] Tokyo, Japan ( )