[ Usenet FAQs | Web FAQs | Documents | RFC Index ]
    Search the FAQ Archives

Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Single Page

Top Document: comp.windows.x Frequently Asked Questions (FAQ) 7/7
Previous Document: 173) What is the difference between a Screen and a screen?
Next Document: 175) How do I create a transparent window?


174) Can XGetWindowAttributes get a window's background pixel/pixmap?



No.  Once set, the background pixel or pixmap of a window cannot be re-read
by clients.  The reason for this is that a client can create a pixmap, set it
to be the background pixmap of a window, and then free the pixmap. The window
keeps this background, but the pixmap itself is destroyed.  If you're sure a
window has a background pixel (not a pixmap), you can use XClearArea() to
clear a region to the background color and then use XGetImage() to read back
that pixel.  However, this action alters the contents of the window, and it
suffers from race conditions with exposures. [courtesy Dave Lemke of NCD and
Stuart Marks of Sun]

Note that the same applies to the border pixel/pixmap. This is a (mis)feature
of the protocol which allows the server to manipulate the pixel/pixmap
however it wants.  By not requiring the server to keep the original pixel or
pixmap, some (potentially a lot of) space can be saved.  [courtesy Jim
Fulton, then of X Consortium]



Top Document: comp.windows.x Frequently Asked Questions (FAQ) 7/7
Previous Document: 173) What is the difference between a Screen and a screen?
Next Document: 175) How do I create a transparent window?

Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Single Page


[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
faq%craft@uunet.uu.net (X FAQ maintenance address)

Last Update October 22 2009 @ 05:36 AM

Some parts © 2009 Advameg, Inc.