@Override public boolean useBufferPerWindow(){
  return !Win32GraphicsEnvironment.isDWMCompositionEnabled();
}

@ Override public boolean useBufferPerWindow ( ) { return ! Win32GraphicsEnvironment . isDWMCompositionEnabled ( ) ; }
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 .
