JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Solaris X Window System Developer's Guide
search filter icon
search icon

Document Information


1.  Introduction to the Solaris X Server

2.  DPS Features and Enhancements

3.  Visuals on the Solaris X Server

4.  Font Support

5.  Server Overlay Windows

6.  Transparent Overlay Windows

What are Transparent Overlay Windows?

Basic Characteristics of Transparent Overlay Windows

Paint Type


More on Transparent Overlay Characteristics


Window Border

Backing Store

Window Gravity


Input Distribution Model

Print Capture

Choosing Visuals for Overlay/Underlay Windows

Example Program

Overview of the Solaris Transparent Overlay Window API

Creating Transparent Overlay Windows

Setting the Paint Type of a Graphics Context

Setting the Background State of a Transparent Overlay Window

Rendering to a Transparent Overlay Window

Querying the Characteristics of a Transparent Overlay Window

Determining Whether a Window is an Overlay Window

Determining the Paint Type of a Graphics Context

Pixel Transfer Routines

Filling an Area Using the Source Area Paint Type

Copying an Area and Its Paint Type

Retrieving Overlay Color Information

Using Existing Xlib Pixel Transfer Routines


XCopyArea and XCopyPlane

Designing an Application for Portability

Selecting a Visual for an Overlay/Underlay Window

Argument Types

Return Types

Multiple Criteria Sets

Selecting an Optimal Overlay/Underlay Visual Pair

Argument Types

Return Types

Criteria Sets

7.  Security Issues

A.  Reference Display Devices



Example Program

The program below demonstrates a simple example of a transparent overlay. The program creates a transparent overlay window, draws the window border in white, displays a text string in white, and draws a white filled rectangle. The paint type is opaque by default, and the window background is transparent by default. Use the following Makefile to compile and link the program.


simple.c   cc -I../ -I/usr/openwin/include -o simple simple.c \ 

 -L/usr/openwin/lib -lX11 -lXext

Example 6-1 Transparent Overlay Example Program

#include <stdio.h> #include 

<X11/Xlib.h>  #include “X11/Xmd.h”  #include

<X11/extensions/transovl.h>  #include

<X11/extensions/transovlstr.h> Display       *display;  Window

window;  XSetWindowAttributes       attribs; GC       gc;  XGCValues

      gcvalues; main()  {   display = XOpenDisplay(““);

attribs.override_redirect = True;

attribs.border_pixel = WhitePixel(display,0);

window = XSolarisOvlCreateWindow(display,      DefaultRootWindow(display),

100, 100, 500, 500, 10,      CopyFromParent, InputOutput,CopyFromParent, 

CWBorderPixel | CWOverrideRedirect, &attribs); gcvalues.font =

XLoadFont(display, “fixed”);

gcvalues.foreground =WhitePixel(display, 0);

gc = XCreateGC(display, window, GCFont | GCForeground,&gcvalues);

XMapWindow(display, window); XDrawString(display, window,

gc, 50, 50, “This is a test”, 14);

XFillRectangle(display,window, gc, 70, 70, 100, 100); 

XFlush(display); while   (1);}