3.3 Creating Windows

Xlib provides basic ways for creating windows, and toolkits often supply higher-level functions specifically for creating and placing top-level windows, which are discussed in the appropriate toolkit documentation. If you do not use a toolkit, however, you must provide some standard information or hints for the window manager by using the Xlib inter-client communication functions.

If you use Xlib to create your own top-level windows (direct children of the root window), you must observe the following rules so that all applications interact reasonably across the different styles of window management:

For further information, see "Inter-Client Communication Functions" and the Inter-Client Communication Conventions Manual.

XCreateWindow() is the more general function that allows you to set specific window attributes when you create a window. XCreateSimpleWindow() creates a window that inherits its attributes from its parent window.

The X server acts as if InputOnly windows do not exist for the purposes of graphics requests, exposure processing, and VisibilityNotify events. An InputOnly window cannot be used as a drawable (that is, as a source or destination for graphics requests). InputOnly and InputOutput windows act identically in other respects (properties, grabs, input control, and so on). Extension packages can define other classes of windows.

To create an unmapped window and set its window attributes, use XCreateWindow().

To create an unmapped InputOutput subwindow of a given parent window, use XCreateSimpleWindow().

Next: Destroying Windows

Christophe Tronche, [email protected]