Shape Extension
   HOME

TheInfoList



OR:

In the
X Window System The X Window System (X11, or simply X) is a windowing system for bitmap displays, common on Unix-like operating systems. X provides the basic framework for a GUI environment: drawing and moving windows on the display device and interacting wit ...
, the X Nonrectangular Window Shape Extension allows
window A window is an opening in a wall, door, roof, or vehicle that allows the exchange of light and may also allow the passage of sound and sometimes air. Modern windows are usually glazed or covered in some other transparent or translucent materia ...
s to be given arbitrary, non-rectangular shapes. Two well-known applets that use the shape extension are ''oclock'', which is a simple round analog clock, and '' xeyes'', which shows two googly eyes that follow the
cursor Cursor may refer to: * Cursor (user interface), an indicator used to show the current position for user interaction on a computer monitor or other display device * Cursor (databases), a control structure that enables traversal over the records in ...
on the screen as if they were watching it. Most X systems have one or the other (or both) in their standard installations. In addition, some window managers use the shape extension to draw non-rectangular icons.


Implementation

Applications can only create rectangular windows, but can then change their shape to be an arbitrary part of the original rectangle. The remaining area of the rectangle is not only transparent (shows what is below the window); rather, it is not part of the window at all. For example, if a window is shaped with a hole in the middle, not only the hole shows what is below the window, but a click in the hole is considered to be a click in what is below the window. Applications create windows as usual (specifying width and height), but can then change the shape of a window to be a subset of the original area. by sending the X
display server In computing, a windowing system (or window system) is software that manages separately different parts of display screens. It is a type of graphical user interface (GUI) which implements the WIMP (windows, icons, menus, pointer) paradigm for ...
either a list of rectangles or a
pixmap In computing, a bitmap is a mapping from some domain (for example, a range of integers) to bits. It is also called a bit array or bitmap index. As a noun, the term "bitmap" is very often used to refer to a particular bitmapping application: the ...
of
color depth Color depth or colour depth (see spelling differences), also known as bit depth, is either the number of bits used to indicate the color of a single pixel, or the number of bits used for each color component of a single pixel. When referring to ...
one (a black-and-white pixmap). More precisely, a client can request the rectangles or the pixmap to be set as the new shape, but also to be combined in various ways (e.g., intersected or added) with the old shape. A third way for changing the shape of a window is by using the current shape of a window or a part of it. The extension allows defining the shape of two separate regions: the clipping and the bounding regions. These two areas are defined even for windows not using the shape extension: the clipping region is the area that can be used for drawing, the bounding region is the total area covered by the window (that is, the clipping region plus the border). The shape extension allows defining two independent shapes for these two regions. Both the clipping and bounding are associated, in the shape extension, two areas: a default rectangular region and a possibly non-rectangular client region, defined and changed by the client as specified above. The effective region, which is the actual shape of the window, is the intersection of these two areas. This intersection is performed every time either region is changed: for example, if the client regions contains parts that are outside the default region but the default region is then enlarged, the effective region will include these parts.


See also

* X Window System core protocol


External links


X Nonrectangular Window Shape Extension Library
{{XWinSys X Window extensions