Root window
Encyclopedia
In the X Window System
, every window
is contained within another window, called its parent. This makes the windows form a hierarchy
. The root window is the root of this hierarchy. It is as large as the screen, and all other windows are either children or descendants of it.
Since every window covers the part of its parent it is staying on, all other windows appear to be above the root window. As a result, the root window is visible as the part of the screen that is behind all other windows. In other words, the root window forms the background of the screen. An image can be used as the wallpaper
of the screen by setting it as the background image of the root window. This can be done for example using the
programs.
The direct children of the root window are called top-level windows. These windows are usually drawn with a decorative frame and a title bar (which are actually added by the window manager
). The top-level windows are, informally, the regular windows in the terminology of most GUI
s. The windows that are not top-level are used for buttons, textboxes, etc.
The properties of the root window are sometimes used as a rudimentary form of inter-client communication means. For example, the cut buffers
are properties of the root window that are used for copying selected text from a window to another, and the dwm
window manager displays the root window's name in a status area. The X resources
are also stored, during execution, in a property of the root window.
window manager introduced the virtual root window. From the point of view of the X protocol, this is a regular window. However, X window manager
s using the virtual root window reparent all windows to it instead to the real root window. Virtual root windows are mainly used by virtual window managers, for example for realizing a number of virtual desktop
s the user can switch between.
Other clients (beside the window manager) may need to use the virtual root window. The identifier of this window can be found in a window property named
The freedesktop window manager specification requires a property named
The virtual root window is used by the window managers swm, tvtwm
, amiwm
, and enlightenment
. Other systems such as KDE
use a virtual background window (which contains the icons, for example) but do not reparent the other windows to this one. The virtual root window is also used by XScreenSaver
: when the screensaver is activated, this program creates a virtual root window, places it at the top of all other windows, and calls one of its hacks (modules), which finds the virtual root window and draws in it.
X Window System
The X window system is a computer software system and network protocol that provides a basis for graphical user interfaces and rich input device capability for networked computers...
, every window
Window
A window is a transparent or translucent opening in a wall or door that allows the passage of light and, if not closed or sealed, air and sound. Windows are usually glazed or covered in some other transparent or translucent material like float glass. Windows are held in place by frames, which...
is contained within another window, called its parent. This makes the windows form a hierarchy
Hierarchy
A hierarchy is an arrangement of items in which the items are represented as being "above," "below," or "at the same level as" one another...
. The root window is the root of this hierarchy. It is as large as the screen, and all other windows are either children or descendants of it.
Since every window covers the part of its parent it is staying on, all other windows appear to be above the root window. As a result, the root window is visible as the part of the screen that is behind all other windows. In other words, the root window forms the background of the screen. An image can be used as the wallpaper
Computer wallpaper
Wallpaper is an image used as a background of a graphical user interface on a computer screen or mobile communications device. On a computer it is usually for the desktop, while for a mobile phone it is usually the background for the 'home' or 'idle' screen...
of the screen by setting it as the background image of the root window. This can be done for example using the
xsetroot
or the xvXv
xv is a shareware program written by John Bradley to display and modify digital images under the X Window System.While popular in the early 1990s , no official releases have been made since December 1994...
programs.
The direct children of the root window are called top-level windows. These windows are usually drawn with a decorative frame and a title bar (which are actually added by the window manager
Window manager
A window manager is system software that controls the placement and appearance of windows within a windowing system in a graphical user interface. Most window managers are designed to help provide a desktop environment...
). The top-level windows are, informally, the regular windows in the terminology of most GUI
Gui
Gui or guee is a generic term to refer to grilled dishes in Korean cuisine. These most commonly have meat or fish as their primary ingredient, but may in some cases also comprise grilled vegetables or other vegetarian ingredients. The term derives from the verb, "gupda" in Korean, which literally...
s. The windows that are not top-level are used for buttons, textboxes, etc.
The properties of the root window are sometimes used as a rudimentary form of inter-client communication means. For example, the cut buffers
X Window selection
Selections, cut buffers, and drag-and-drop are the mechanisms used in the X Window System to allow a user to transfer data from a window to another. Selections and cut buffer are typically used when a user selects text or some other data in a window and pastes in another one...
are properties of the root window that are used for copying selected text from a window to another, and the dwm
Dwm
dwm is a dynamic tiling window manager for X11 exhibiting the principles of minimalism which is known for having influenced the development of other window managers, including xmonad and awesome. It is externally similar to wmii, but internally much simpler. dwm is written purely in C and, for...
window manager displays the root window's name in a status area. The X resources
X resources
In the X Window System, the X resources are parameters of computer programs such as the name of the font used in the buttons, the background color of menus, etc. They are used in conjunction with or as an alternative to command line parameters and configuration files.- Format :At the X protocol...
are also stored, during execution, in a property of the root window.
Virtual root window
The swmSwm
swm is an X Window System window manager developed by Tom LaStrange at Solbourne Computer in 1990. The most important innovation of swm was the introduction of the virtual desktop...
window manager introduced the virtual root window. From the point of view of the X protocol, this is a regular window. However, X window manager
X window manager
An X window manager is a window manager which runs on top of the X Window System, a windowing system mainly used on Unix-like systems.Unlike the Mac OS and Microsoft Windows platforms which have historically provided a vendor-controlled, fixed set of ways to control how windows and panes display...
s using the virtual root window reparent all windows to it instead to the real root window. Virtual root windows are mainly used by virtual window managers, for example for realizing a number of virtual desktop
Virtual desktop
In computing, a virtual desktop is a term used with respect to user interfaces, usually within the WIMP paradigm, to describe ways in which the size of a computer's desktop environment is expanded beyond the physical limits of the screen's real estate through the use of software, This saves space...
s the user can switch between.
Other clients (beside the window manager) may need to use the virtual root window. The identifier of this window can be found in a window property named
__SWM_VROOT
in a direct child of the real root window. Technically, many programs use the macros for finding the root windows as redefined by an include file named vroot.h
.The freedesktop window manager specification requires a property named
_NET_VIRTUAL_ROOTS
of the real root window to contain a list of the windows that are acting as virtual root windows; the virtual root window that is currently active can be found in the property _NET_CURRENT_DESKTOP
of the real root window.The virtual root window is used by the window managers swm, tvtwm
Tvtwm
tvtwm is an X window manager derived from twm to which it adds the virtual desktop feature from swm. All of these window managers were originally written by Tom LaStrange...
, amiwm
Amiwm
In computing, the AMIga Window Manager is a stacking window manager for the X Window System.Amwim was written by Marcus Comstedt. "The purpose of amiwm is to make life more pleasant for Amiga-freaks like myself who has/wants to use UNIX workstations once in a while."Amiwm emulates the Amiga...
, and enlightenment
Enlightenment (window manager)
Enlightenment, also known simply as E, is a stacking window manager for the X Window System which can be used alone or in conjunction with a desktop environment such as GNOME or KDE...
. Other systems such as KDE
KDE
KDE is an international free software community producing an integrated set of cross-platform applications designed to run on Linux, FreeBSD, Microsoft Windows, Solaris and Mac OS X systems...
use a virtual background window (which contains the icons, for example) but do not reparent the other windows to this one. The virtual root window is also used by XScreenSaver
XScreenSaver
XScreenSaver is a collection of about two hundred free screensavers for Unix and Mac OS X computers. It was created by Jamie Zawinski in 1992 and is still maintained by him....
: when the screensaver is activated, this program creates a virtual root window, places it at the top of all other windows, and calls one of its hacks (modules), which finds the virtual root window and draws in it.
External links
- Extended Window Manager Hints from freedesktop.org
- toon_root.c, a source file of XPenguinsXPenguinsXPenguins is an X Window System screenmate program that shows an animation of various penguins involved in various activities, such as reading, falling, digging, skating, etc. The program moves the penguins around as if the windows were solid objects the penguins could stay, walk, or skate on. The...
that contains information about virtual root/desktop windows for various window managers