All Topics  
Desktop Window Manager

 

   Email Print
   Bookmark   Link






 

Desktop Window Manager



 
 
Desktop Window Manager (DWM, previously Desktop Compositing Engine or DCE) is a compositing window manager
Compositing window manager

A compositing window manager is a component of a computer's graphical user interface that draws windows and/or their borders. It also controls how they are displayed and interact with each other, and the rest of the desktop environment....
, introduced with Windows Vista
Windows Vista

Windows Vista is one member in a family of operating systems developed by Microsoft for use on personal computers, including home and business Desktop computer, laptops, Tablet PCs, and media center PCs....
, that enables the Windows Aero
Windows Aero

Windows Aero is the graphical user interface and the default theme in most editions of Windows Vista, an operating system released by Microsoft on 31 January 2007....
 graphical user interface
Graphical user interface

A graphical user interface is a type of user interface which allows people to human-computer interaction such as computers; hand-held devices such as MP3 Players, Portable Media Players or Gaming devices; household appliances and office equipment....
 and visual theme. The Desktop Window Manager requires video cards supporting DirectX
DirectX

Microsoft DirectX is a collection of application programming interfaces for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms....
 9.0 and Shader Model 2.0. DWM is not included with Windows Vista Starter edition. It is included with Windows Vista Home Basic edition, but with some aspects of the Windows Aero interface (such as transparent Glass and Flip 3D) disabled.






Discussion
Ask a question about 'Desktop Window Manager'
Start a new discussion about 'Desktop Window Manager'
Answer questions from other users
Full Discussion Forum



Encyclopedia


Desktop Window Manager (DWM, previously Desktop Compositing Engine or DCE) is a compositing window manager
Compositing window manager

A compositing window manager is a component of a computer's graphical user interface that draws windows and/or their borders. It also controls how they are displayed and interact with each other, and the rest of the desktop environment....
, introduced with Windows Vista
Windows Vista

Windows Vista is one member in a family of operating systems developed by Microsoft for use on personal computers, including home and business Desktop computer, laptops, Tablet PCs, and media center PCs....
, that enables the Windows Aero
Windows Aero

Windows Aero is the graphical user interface and the default theme in most editions of Windows Vista, an operating system released by Microsoft on 31 January 2007....
 graphical user interface
Graphical user interface

A graphical user interface is a type of user interface which allows people to human-computer interaction such as computers; hand-held devices such as MP3 Players, Portable Media Players or Gaming devices; household appliances and office equipment....
 and visual theme. The Desktop Window Manager requires video cards supporting DirectX
DirectX

Microsoft DirectX is a collection of application programming interfaces for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms....
 9.0 and Shader Model 2.0. DWM is not included with Windows Vista Starter edition. It is included with Windows Vista Home Basic edition, but with some aspects of the Windows Aero interface (such as transparent Glass and Flip 3D) disabled. It is also included with Windows Server 2008, but requires the "Desktop Experience" feature and compatible graphics drivers to be installed.

Architecture

With the Desktop Window Manager, applications do not draw directly to the video memory; instead, they draw their contents to off-screen buffers in system memory that are then composited together by DWM to render the final screen, a number of times per second. In that sense, it is similar to the Quartz Compositor
Quartz Compositor

Quartz Compositor is the windowing system in Mac OS X. It is responsible for presenting and maintaining rasterized, rendered graphics from the rest of the Core Graphics framework and other renderers in the Quartz family....
 in Mac OS X
Mac OS X

Mac OS X is a line of computer operating systems developed, marketed, and sold by Apple Inc., and since 2002 has been included with all new Macintosh computer systems....
. Because the compositor has access to the graphics of all applications, it easily allows visual effects that string together visuals from multiple applications, such as transparency. The DWM uses DirectX 9
DirectX

Microsoft DirectX is a collection of application programming interfaces for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms....
 to perform the function of compositing and rendering in the GPU, freeing the CPU of the task of managing the rendering from the off-screen buffers to the display. However, it does not affect applications painting to the off-screen buffers; depending on the technologies used for that, it might still be CPU-bound. DWM-agnostic rendering techniques like GDI
GDI

GDI is an acronym that can stand for:* Gasoline direct injection, a modern variant of fuel injection* Gender-related Development Index, an indication of the standard of living in a country, developed by the United Nations...
 are redirected to the buffers by rendering the UI as bitmap
Bitmap

In computer graphics, a bitmap or pixmap is a type of computer storage organization or used to store digital images. The term bitmap comes from the computer programming terminology, meaning just a map of bits, a spatially mapped bit array....
s. DWM-aware rendering technologies like WPF
Windows Presentation Foundation

The Windows Presentation Foundation , formerly code-named Avalon, is a graphical subsystem in .NET Framework 3.0 , which uses a markup language, known as Extensible Application Markup Language, for rich user interface development....
 directly make the internal data structures available in a DWM-compatible format. The window contents in the buffers are then converted to DirectX textures.

The desktop itself is a full-screen Direct3D
Direct3D

Direct3D is part of Microsoft's DirectX application programming interface. Direct3D is only available for Microsoft's various Microsoft Windows operating systems and is the base for the graphics API on the Xbox and Xbox 360 console systems....
 surface, with windows being represented as a mesh consisting of two adjacent (and mutually-inverted) triangles, which are transformed to represent a 2D rectangle. The texture, representing the UI chrome, is then mapped onto these rectangles. Window transitions are implemented as transformations of the meshes, using shader
Shader

A shader in the field of computer graphics is a set of software instructions, which is used primarily to calculate Rendering effects on graphics hardware with a high degree of flexibility....
 programs. With Windows Vista, the transitions are limited to the set of built-in shaders that implement the transformations. Greg Schechter, a developer at Microsoft has suggested that it might be opened up for developers and users to plug in their own effects in a future release. The DWM only maps the primary desktop object
Object Manager (Windows)

Object Manager is a subsystem implemented as part of the Windows Executive which manages Windows resources. Each resource, which are surfaced as logical objects, resides in a namespace for categorization....
 as a 3D surface; other desktop objects, including virtual desktops as well as the secure desktop used by User Account Control
User Account Control

User Account Control is a technology and security infrastructure introduced with Microsoft's Windows Vista operating system. It aims to improve the security of Microsoft Windows by limiting application software to standard user privileges until an System administrator authorizes an increase in privilege level....
 are not. Since all applications render to an off-screen buffer, they can be read off the buffer embedded in other applications as well. Since the off-screen buffer is constantly updated by the application, the embedded rendering will be a dynamic representation of the application window and not a static rendering. This is how the live thumbnail previews, Windows Flip and Windows Flip 3D
Features new to Windows Vista

Windows Vista has many new features compared with previous Microsoft Windows versions, covering most aspects of the operating system.This article discusses the changes most likely to be of interest to non-technical users....
 work in Windows Vista
Windows Vista

Windows Vista is one member in a family of operating systems developed by Microsoft for use on personal computers, including home and business Desktop computer, laptops, Tablet PCs, and media center PCs....
. The DWM exposes a public API that allows applications to access these thumbnail representations. The size of the thumbnail is not fixed; applications can request the thumbnails at any size - smaller than the original window, at the same size or even larger - and DWM will scale them properly before returning. Windows Flip 3D uses the thumbnail APIs to get the window representations as bitmaps, and then uses that as texture for 2D rectangles, which are further processed by custom shaders to transform them to 3D meshes and rotate them in a 3D plane.

The Desktop Window Manager uses Media Integration Layer (MIL), the unmanaged compositor which it shares with Windows Presentation Foundation
Windows Presentation Foundation

The Windows Presentation Foundation , formerly code-named Avalon, is a graphical subsystem in .NET Framework 3.0 , which uses a markup language, known as Extensible Application Markup Language, for rich user interface development....
, to represent the windows as composition nodes in a composition tree, representing the desktop and all the windows hosted in it, which are then rendered by MIL from back of the scene to the front. Since all the windows contribute to the final image, the color of a resultant pixel can be decided by more than one window. This is used to implement effects such as per-pixel transparency. DWM allows custom shaders to be invoked to control how pixels from multiple applications are used to create the resultant pixel. The DWM includes built-in Pixel shader
Pixel shader

A pixel shader is a shader program, often executed on a graphics processing unit. It adds 3D shading and lighting effects to pixels in an image, for example those in video games....
 2.0 programs that computes the color of a pixel in a window by averaging the color of the pixel as determined by the window behind it and its neighboring pixels. These shaders are used by DWM to achieve the blur effect in the window borders of windows managed by DWM, and optionally for the areas where it is requested by the application.

Since MIL provides a retained mode
Retained mode

In computing, retained mode rendering is a style for application programming interfaces of graphics libraries, in which the libraries retain a complete model of the objects to be rendered....
 graphics system by caching the composition trees, the job of repainting and refreshing the screen when windows are moved is handled by DWM and MIL, freeing the application of the responsibility. The background data is already in the composition tree and the off-screen buffers, that is directly used to render the background, without having the background applications to re-render themselves by sending them the WM_PAINT message, as was the case with pre-Vista Windows OSs. DWM uses double-buffered
Double buffering

In computer science, double buffering is a widely used technique for minimizing the delay in input/output operations which use a buffer . Single buffering is affected by buffer underrun and buffer overflow....
 graphics to prevent flickering and tearing during window moves. The compositing engine uses optimizations such as culling
Back-face culling

In computer graphics, back-face culling determines whether a polygon of a graphical object is visible, depending on the position of the camera. It is a step in the graphical pipeline that tests whether the points in the polygon appear in clockwise or counter-clockwise order when projected onto the screen....
 to improve performance, as well as not redrawing areas that haven't changed. Because the compositor is multi-monitor aware, the DWM natively supports that too.

During full-screen applications, such as games, the DWM does not perform window compositing and therefore performance will not appreciably decrease.

Redirection

For rendering techniques that are not DWM-aware, output must be redirected to the DWM buffers. With Windows, either GDI
Graphics Device Interface

The Graphics Device Interface is a Microsoft Windows application programming interface and core operating system component that is responsible for representing graphical objects and transmitting them to output devices such as computer display and computer printer....
 or DirectX
DirectX

Microsoft DirectX is a collection of application programming interfaces for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms....
 can be used for rendering. To make these two work with DWM, redirection techniques for both are provided with DWM.

With GDI, which is the most used UI rendering technique in Microsoft Windows
Microsoft Windows

Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces ....
, each application window is notified when it or a part of it comes in view and it is the job of the application to render itself. Without DWM, the rendering rasterizes
Raster graphics

In computer graphics, a raster graphics image or bitmap, is a data structure representing a generally Rectangle grid of pixels, or points of color, viewable via a Computer display, paper, or other display medium....
 the UI in a buffer in video memory, from where it is rendered to the screen. Under DWM, a buffer equal to the size of the window is allocated in system memory. GDI calls are redirected to write their outputs to this buffer, rather than the video memory. Another buffer is allocated in the video memory to represent the DirectX surface, which is used as the texture for the Window meshes. The system memory buffer is converted to the DirectX surface separately, and kept in sync. This round-about route is required as GDI cannot output directly in DirectX pixel format. The surface is read by the compositor and is composited to the desktop in video memory. Writing the output of GDI to system memory is not hardware accelerated, nor is conversion to DirectX surface. When a GDI window is minimized, by the limitations of GDI, the buffer is no longer updated. So, DWM uses the last bitmap rendered to the buffer before the application was minimized.

For applications using DirectX
DirectX

Microsoft DirectX is a collection of application programming interfaces for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms....
 to write to a 3D surface, the DirectX implementation in Windows Vista
Windows Vista

Windows Vista is one member in a family of operating systems developed by Microsoft for use on personal computers, including home and business Desktop computer, laptops, Tablet PCs, and media center PCs....
 uses WDDM
Windows Display Driver Model

Windows Display Driver Model is the graphic driver architecture for video card device driver running Microsoft Windows versions beginning with Windows Vista....
 to share the surface with DWM. DWM then uses the surface directly and maps it on to the window meshes. For WPF applications, which are DirectX applications, the compositor renders to such shared surfaces, which are then composited into the final desktop. Applications can mix either rendering technique across multiple child windows, as long as both GDI and DirectX are not used to render the same window. In that case, the ordering between DirectX and GDI rendering cannot be guaranteed, and as such it cannot be guaranteed whether the GDI bitmap from the system memory has been translated to the video memory surface. So, the final composition may not contain the GDI-rendered elements. To prevent this, DWM is temporarily turned off, as long as an application which mixes GDI
GDI

GDI is an acronym that can stand for:* Gasoline direct injection, a modern variant of fuel injection* Gender-related Development Index, an indication of the standard of living in a country, developed by the United Nations...
 and DirectX
DirectX

Microsoft DirectX is a collection of application programming interfaces for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms....
 in the same window is running.

Hardware requirements

DWM requires compatible phyical or virtual hardware:
  • A GPU
    Graphics processing unit

    A graphics processing unit or GPU is a dedicated graphics rendering device for a personal computer, workstation, or game console. Modern GPUs are very efficient at manipulating and displaying computer graphics, and their highly parallel structure makes them more effective than general-purpose Central processing unit for a range of com...
     that supports the Windows Driver Display Model (WDDM)
  • DirectX
    DirectX

    Microsoft DirectX is a collection of application programming interfaces for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms....
     9 support
  • Pixel Shader 2.0 support,
  • Support for 32 bits per pixel
  • Passes the Windows Aero acceptance test in the Windows Driver Kit (WDK)


As of February 2009, neither Hyper-V
Hyper-V

Microsoft Hyper-V, codenamed Viridian, formerly known as Windows Server Virtualization, is a hypervisor-based virtualization system for x86-64 systems....
 nor VMware
VMware

VMware, Inc. is a software developer of virtualization software. The company was founded in 1998 and is based in Palo Alto, California. The Company is majority owned by EMC Corporation ....
 virtual machines meet the hardware requirements.

External links