Solaris X Window System Developer's Guide

Basic Characteristics of Transparent Overlay Windows

A transparent overlay window is a special class of an X InputOutput window into which pixels can be rendered transparently. Handles to transparent overlay windows have the X window type Window. Just like standard X windows, overlay windows are drawables, and an overlay window handle can be passed to any Xlib drawing routine that takes a Drawable.

Transparent overlay windows have extended the set of graphics context attributes to include an attribute for paint type. With the transparent overlay extension, transparent overlay windows can be rendered to with either opaque or transparent paint.

Paint Type

While standard X InputOutput windows and other drawables (such as pixmaps) accept only opaque paint, transparent overlay windows permit pixels to be rendered with transparent paint. Valid pixel values painted opaquely obscure pixels in underlying windows. Such pixels have associated color values that are displayed. Pixels rendered transparently have no intrinsic color; they derive their displayed color from the pixels that lie beneath.

Valid pixel values for pixels painted opaquely are obtained via XAllocColor() or another standard pixel allocation mechanism. Painting opaquely with a non-valid pixel value, for example a value that falls outside the valid colormap entries for a visual, produces undefined results for both transparent overlay windows and standard X InputOutput windows.

Paint type is defined with the data structure XSolarisOvlPaintType. By default, the paint type of a GC is opaque. The XSolarisOvlPaintType data structure is defined as:


enum { 	XSolarisOvlPaintTransparent, 	XSolarisOvlPaintOpaque, }



A transparent overlay window is considered viewable even if all its pixels are fully transparent. For viewable pixels in a transparent overlay window that are fully transparent, the underlying pixels in the underlay will be displayed.

If an overlay window is unmapped or moved, the underlay beneath may receive exposure events. This, for example, is the case on devices that cannot display the overlay window and underlay window in different plane groups.