<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">I was able to successfully create a translucent window using xlib and then set the transparency using the XRender extension, and make the window have rounded corners with the Xshape extension and the following code:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class="">void rectAttributes(XRectangle *rect ,int width, int height, int x, int y) {</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> rect->height = height;</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> rect->width = width;</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> rect->x=x;</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> rect->y=y;</div></div></blockquote></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class="">}</div></div><div class=""><div style="text-align: left;" class=""><br class=""></div></div><div class=""><div style="text-align: left;" class="">void createRoundedEdges(int radius, Display *display, Window window) {</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> XWindowAttributes attr;</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> XGetWindowAttributes(display,window, &attr);</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> int windowHeight = attr.height,</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> windowWidth = attr.width,</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> cornerCoordinates[radius],</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> x_bar = windowWidth - radius;</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> XRectangle rect[(radius*4)]; //*4 because of 4 corners</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> /* Populate the firstCorner array */</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> for (int i=radius; i!=0; i--) {</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> int y = i,</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> x = sqrt((radius*radius)-(y*y));</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> cornerCoordinates[radius-i] = x;</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> }</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> for (int i=0,j=radius,k=2*j,l=3*j;i<radius;i++,j++,k++,l++) {</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> rectAttributes(&rect[i],windowWidth,1,x_bar+cornerCoordinates[i],i); //top-right</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> rectAttributes(&rect[j],windowWidth,1,x_bar+cornerCoordinates[(2*radius)-1-j] //bottom-right</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> ,windowHeight-(2*radius)+j);</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> rectAttributes(&rect[k],windowWidth,1,radius-windowWidth-cornerCoordinates[i],i); //top-left</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> rectAttributes(&rect[l],windowWidth,1,rect[k].x,windowHeight-1-i); //bottom-left</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> }</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> int sizeOfArray = sizeof(rect)/sizeof(rect[0]);</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class=""> XShapeCombineRectangles(display,window,0,0,0,rect,sizeOfArray,ShapeSubtract,0);</div></div></blockquote></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div style="text-align: left;" class="">}</div></div></blockquote><div class=""><br class=""></div><div class="">This is what the above code generates:</div><div class=""><br class=""></div><div class=""><img apple-inline="yes" id="93657D87-5FF2-431C-ABA2-F7295076B3AF" width="737" height="731" src="cid:587AA4B0-B1D6-4865-889D-25356C0EBCCC@hfs.colostate.edu" class=""></div><div class=""><br class=""></div><div class="">If you look closely at the rounded corners, they seem to be not smooth but rather jagged, and to make those corners smooth I’d have to do ant-aliasing on the window. I could do that in two ways, one is by writing the anti-aliasing algorithm and placing pixels with differing alpha values along the edges using Xrender, or by finding an extension that does the anti-aliasing on the window. So, I was wondering if you could point me to an anti-aliasing extension that I can use to make the corners smooth mostly because I really don’t want to spend the time writing an antialiasing algorithm from scratch if an extension already exists that does just that.</div><div class=""><br class=""></div><div class="">Thanks!</div><div class="">Sajeeb Roy</div></body></html>