question: @ Override public boolean useBufferPerWindow ( ) { return ! Win32GraphicsEnvironment . isDWMCompositionEnabled ( ) ; }
target:  There are two reasons why we don't use buffer per window when Vista's DWM (aka Aero) is enabled: - since with DWM all windows are already double-buffered, the application doesn't get expose events so we don't get to use our true back-buffer, wasting memory and performance (this is valid for both d3d and gdi pipelines) - in some cases with buffer per window enabled it is possible for the paint manager to redirect rendering to the screen for some operations (like copyArea), and since bpw uses its own BufferStrategy the d3d onscreen rendering support is disabled and rendering goes through GDI. This doesn't work well with Vista's DWM since one can not perform GDI and D3D operations on the same surface (see 6630702 for more info) Note: even though DWM composition state can change during the lifetime of the application it is a rare event, and it is more often that it is temporarily disabled (because of some app) than it is getting permanently enabled so we can live with this approach without the complexity of dwm state listeners and such. This can be revisited if proved otherwise.