| | | 
Administrator

Group: Administrators Last Login: 11/11/2008 9:24:04 PM Posts: 2,103, Visits: 2,251 |
| Under the Hood of the Desktop Window ManagerI've made a grand total of one post in about the last 21 months. What have I been doing during this time? Why, working on the new Desktop Window Manager for Windows Vista, of course! The Desktop Window Manager (DWM) is one of the more visible features and changes to Windows coming out with the upcoming Windows Vista release. Does this mean that I've abandoned Windows Presentation Foundation (Avalon) to work on the DWM? By no means. The DWM is built upon the core graphics layer of Avalon, and is being developed by the same team responsible for Avalon. We've been heads down on design, development, and testing for quite some time, but now that there's an end in sight, I figured I'd come up for air and describe a bit about what we've done and the technical underpinnings of this visible feature. There's lots and lots that can potentially be discussed, so I'm going to keep this first post fairly broad and high level, and will be interested in feedback if there are other specific areas of interest that readers would like to delve further into. So please do comment with your thoughts! The public face of the Desktop Window ManagerThe DWM is of course just part of Windows Vista and not considered distinct from it. Its features are exclusively available in the Windows Vista Aero experience. I'm pulling out some of the more recognizable features here. Desktop CompositionBy far the largest change to Windows Vista in the way that windows are presented is the introduction of "desktop composition". This underlies everything that is done by the DWM. The primary takeaway for desktop composition: the way an application gets pixels on the screen has fundamentally changed. In all versions of Windows, up until Windows XP, applications were asked by Windows to paint their visible region, and they would paint directly to the buffer that was to be displayed by the video card. With Windows Vista, applications are asked by Windows to paint their entire surface to an offscreen surface (alternatively known as a bitmap, buffer, or texture), and it's up to the DWM to take all of these offscreen surfaces, and "compose" them together to the onscreen buffer. Read the previous paragraph again. From a windowing system display perspective, this has profound implications in terms of the features that can be implemented, and the quality that can be achieved. Some examples: - Access to windows - now that applications are rendered offscreen, those offscreen representations can be used in other places. This is precisely how the Flip, Flip3D, and thumbnail features work, and other features can be built that take advantage of this as well.
- Don't involve background applications in window operations - when a window moves across the screen in XP and before, the portions of background windows that are newly visible only get painted when the background application wakes up and starts painting (in response to WM_PAINT messages it receives when the top window is moving). For non-responsive background applications, or even responsive ones that happen to be paged out, this can yield a very poor user experience.
Consider moving an 'Paint' program window over an IE window. On XP and before, the following symptoms are unfortunately all too common:

In both of these cases, the underlying Internet Explorer application was unable to repaint itself quick enough to avoid the "trails" that the moving Paint window left behind.
Under Windows Vista, this simply isn't the case -- underlying windows do not receive WM_PAINTs and are not asked to re-render, since their content is already available to the DWM and is used to composite the screen. - Tear free experience - given that the DWM orchestrates all rendering to the screen, the latest technologies provided by DirectX that are typically used for games can be used for the overall desktop experience. In particular, graphics cards' ability to "flip" the front buffer results in an absolutely tear free experience as windows are moved around the screen, increasing the smoothness and quality of the user experience.
- High resolution support - the majority of applications out there are agnostic of the monitor resolution (DPI) that they're running at. On the increasingly popular higher resolution monitors (120 DPI, 144 DPI, and beyond), this can produce a bad experience where applications appear very small in physical space. Because the DWM has access to offscreen representation of the application window, the DWM is in a unique position to scale such DPI-unaware applications for their final presentation to the user, making for a much improved experience on the higher resolution monitor.
AMD64 X2 5200+ 2.60GHz | 3GB DDR 667 | RAID 0 SATA3.0 WD Caviars 320GB total | Foxconn MCP61VM2MA-RS2H Geforce 6100 nforce400 chipset | Vista Ultimate x86
|
| |
| |
|