Solaris X Window System Developer's Guide

Creating Transparent Overlay Windows

You can create a transparent overlay using XSolarisOvlCreateWindow. This routine behaves exactly as XCreateWindow except that the resulting window is a transparent overlay window. The newly created window can be rendered into with both opaque and transparent paint, and the background of the overlay window is transparent.

The class argument to XSolarisOvlCreateWindow should be InputOutput. An overlay window can be created as an InputOnly window but, in this case, it will behave like a standard InputOnly window. It is only for InputOutput windows that there is a difference between overlay and non-overlay.

The syntax and arguments for XSolarisOvlCreateWindow are shown below.

Window

XSolarisOvlCreateWindow(Display *display, Window parent, int x, int y,

  unsigned int width, unsigned int height,   unsigned int border_width, int

depth, unsigned int class,   Visual * visual, unsigned long valuemask,    

XSetWindowAttributes * attr)

The arguments for this routine are the same as those for XCreateWindow.

display

Specifies the connection to the X server. 

parent

Specifies the parent window. 

x, y

Specifies the coordinates of the upper-left pixel of this window, relative to the parent window. 

width, height

Specifies the width and height, in pixels, of the window. 

border_width

Specifies the width, in pixels, of the window's borders. 

depth

Specifies the depth of the window. 

class

Specifies the class of the window. If the class is not InputOutput, the window will not be an overlay window.

visual

Specifies a pointer to the visual structure for this window. 

valuemask

Specifies which window attributes are defined in the attr argument.

attr

Specifies the attributes of the window. 

You can use any visual to create the overlay. However, not all overlay/underlay visual pairs may be optimal. Each screen defines a set of optimal overlay/underlay visual pairs. These define the optimal visuals of the overlay windows that can be created with a particular underlay visual. Likewise, they define the optimal visuals of underlay windows that can be created with a particular overlay visual. You can determine the optimal pairs using XSolarisOvlSelectPair and XSolarisOvlSelectPartner.

The definition of optimal varies from device to device, but it will usually refer to the ability of a device to create an overlay window in a different plane group than that of an underlay window. See Selecting an Optimal Overlay/Underlay Visual Pair for more information on overlay/underlay visual pairs.

Overlay windows are destroyed with the Xlib routines XDestroyWindow or XDestroySubwindows.