thumb|Layers of the graphical user interface:<br />Under X, the window manager and the [[display server are two distinct programs; but under Wayland, the function of both is handled by the Wayland compositor.]]
thumb|Typical elements of a [[Window (computing)|window. The window decoration is either drawn by the window manager or by the client. The drawing of the content is the task of the client.]]
thumb|Under X11, when no window manager is running, the window decorations are missing.
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. They work in conjunction with the underlying graphical system that provides required functionality—support for graphics hardware, pointing devices, and a keyboard—and are often written and created using a widget toolkit.
Few window managers are designed with a clear distinction between the windowing system and the window manager. Every graphical user interface based on a windows metaphor has some form of window management. In practice, the elements of this functionality vary greatly. Elements usually associated with window managers allow the user to open, close, minimize, maximize, move, resize, and keep track of running windows, including window decorators. Many window managers also come with various utilities and features such as task bars, program launchers, docks to facilitate halving or quartering windows on screen, workspaces for grouping windows, desktop icons, wallpaper, an ability to keep select windows in foreground, the ability to "roll up" windows to show only their title bars, to cascade windows, to stack windows into a grid, to group windows of the same program in the task bar in order to save space, and optional multi-row taskbars.
History
In 1973, the Xerox Alto became the first computer shipped with a working WIMP GUI. It used a stacking window manager that allowed overlapping windows. However, this was so far ahead of its time that its design paradigm would not become widely adopted until more than a decade later. While it is unclear if Microsoft Windows contains designs copied from Apple's classic Mac OS, it is clear that neither was the first to produce a GUI using stacking windows. In the early 1980s, the Xerox Star, successor to the Alto, used tiling for most main application windows, and used overlapping only for dialogue boxes, removing most of the need for stacking.
The classic Mac OS was one of the earliest commercially successful examples of a GUI that used a sort of stacking window management via QuickDraw. Its successor, macOS, uses a somewhat more advanced window manager that has supported compositing since Mac OS X 10.0, and was updated in Mac OS X 10.2 to support hardware accelerated compositing via the Quartz Compositor.
GEM 1.1, from Digital Research, was a operating environment that included a stacking window manager, allowing all windows to overlap. It was released in the early 1980s.
Examples
X window managers
On systems using the X Window System, there is a clear distinction between the window manager and the windowing system. Strictly speaking, an X window manager does not directly interact with video hardware, mice, or keyboards – that is the responsibility of the display server.
A desktop environment typically integrates a default window manager: for instance GNOME 2 uses Metacity, while KDE Plasma Workspaces uses KWin. But X Window System's modular design allows the user to switch to a different window manager: for instance Compiz (a 3D compositing manager) may be used if 3D effects are desired, while Sawfish and awesome instead offer exacting window control. Some components of different window managers can even be mixed and matched; for example, the window decorations from KWin can be used with the desktop and dock components of GNOME.
X window managers also have the ability to re-parent applications, meaning that, while initially all applications are adopted by the root window (essentially the whole screen), an application started within the root window can be adopted by (i.e., put inside of) another window. Window managers under the X window system adopt applications from the root window and re-parent them to apply window decorations (for example, adding a title bar). Re-parenting can also be used to add the contents of one window to another. For example, a flash player application can be re-parented to a browser window, and can appear to the user as supposedly being part of that program. Re-parenting window managers can therefore arrange one or more programs within the same window, and can easily combine tiling and stacking in various ways.
Microsoft Windows
<!-- -->
Microsoft Windows has provided an integrated stacking window manager since Windows 2.0; Windows Vista introduced the compositing Desktop Window Manager (dwm.exe) as an optional hardware-accelerated alternative. In Windows, since GDI is part of the kernel, the role of the window manager is tightly coupled with the kernel's graphical subsystems and is largely non-replaceable, although third-party utilities can be used to simulate a tiling window manager on top of such systems. Window management on Windows can also be enhanced with third-party tools such as WindowBlinds, Resource Hacker, and SmartWindows. Since Windows 8, the Direct3D-based Desktop Window Manager can no longer be disabled. It can only be restarted with the hotkey combination Ctrl+Shift+Win+B.
Windows Explorer (explorer.exe) is used by default as the shell in modern Windows systems to provide a taskbar and file manager, along with many functions of a window manager; aspects of Windows can be modified through the provided configuration utilities, modifying the Windows Registry or with 3rd party tools, such as WindowBlinds or Resource Hacker.
A complete X Windows Server, allowing the use of window managers ported from the unixoid world can also be provided for Microsoft Windows through Cygwin/X even in multiwindow mode (and by other X Window System implementations). Thereby, it is easily possible to e.g. have X Window System client programs running either in the same Cygwin environment on the same machine, or on a Linux, BSD Unix etc. system via the network, and only their GUI being displayed and usable on top of the Microsoft Windows environment.
Note that Microsoft and X Window System use different terms to describe similar concepts. For example, there is rarely any mention of the term window manager by Microsoft because it is integrated and non-replaceable, and distinct from the shell. The Windows Shell is analogous to the desktop environment concept in other graphical user interface systems.
ChromeOS
Since 2021 ChromeOS is shipped with its own window manager called Ash. Chromium and ash share common codebase.
