Hey Chris, So I had a bit more of a look into this - I think the more general problem was that windows which plugins explicitly did not want to paint (eg, they set PAINT_WINDOW_NO_CORE_INSTANCE_MASK) were being factored into the undredirection algorithm when they shouldn't have been. Can you try out the following diff to see if it fixes the minimization problem? It should fix all of the other problems more generally too. Also has some automated test coverage. === modified file 'plugins/opengl/src/fsregion/fsregion.cpp' --- plugins/opengl/src/fsregion/fsregion.cpp 2012-11-29 10:51:38 +0000 +++ plugins/opengl/src/fsregion/fsregion.cpp 2013-05-08 01:42:37 +0000 @@ -48,7 +48,7 @@ { bool fullscreen = false; - if (!(flags & (Desktop | Alpha)) && + if (!(flags & (Desktop | Alpha | NoOcclusionDetection)) && region == untouched && region == orig) { === modified file 'plugins/opengl/src/fsregion/fsregion.h' --- plugins/opengl/src/fsregion/fsregion.h 2012-11-29 10:51:38 +0000 +++ plugins/opengl/src/fsregion/fsregion.h 2013-05-08 01:42:34 +0000 @@ -37,7 +37,8 @@ typedef enum { Desktop = 1, - Alpha = 2 + Alpha = 2, + NoOcclusionDetection = 3 } WinFlag; typedef unsigned int WinFlags; === modified file 'plugins/opengl/src/fsregion/tests/test-fsregion.cpp' --- plugins/opengl/src/fsregion/tests/test-fsregion.cpp 2012-11-29 10:51:38 +0000 +++ plugins/opengl/src/fsregion/tests/test-fsregion.cpp 2013-05-08 02:33:58 +0000 @@ -26,7 +26,7 @@ #include "gtest/gtest.h" #include "fsregion.h" -using namespace compiz::opengl; +using namespace compiz::opengl; TEST (OpenGLFullscreenRegion, NoWindows) { @@ -68,6 +68,25 @@ FullscreenRegion::Desktop)); } +TEST (OpenGLFullscreenRegion, NoOcclusionFullscreen) +{ + FullscreenRegion monitor (CompRect (0, 0, 1024, 768)); + EXPECT_FALSE (monitor.isCoveredBy (CompRegion (0, 0, 1024, 768), + FullscreenRegion::NoOcclusionDetection)); + EXPECT_FALSE (monitor.isCoveredBy (CompRegion (0, 0, 1024, 768), + FullscreenRegion::Desktop)); +} + +TEST (OpenGLFullscreenRegion, NoOcclusionOverFullscreen) +{ + FullscreenRegion monitor (CompRect (0, 0, 1024, 768)); + EXPECT_FALSE (monitor.isCoveredBy (CompRegion (50, 60, 70, 80), + FullscreenRegion::NoOcclusionDetection)); + EXPECT_FALSE (monitor.isCoveredBy (CompRegion (0, 0, 1024, 768))); + EXPECT_FALSE (monitor.isCoveredBy (CompRegion (0, 0, 1024, 768), + FullscreenRegion::Desktop)); +} + TEST (OpenGLFullscreenRegion, NormalWindows) { FullscreenRegion monitor (CompRect (0, 0, 1024, 768)); === modified file 'plugins/opengl/src/paint.cpp' --- plugins/opengl/src/paint.cpp 2013-04-25 17:01:46 +0000 +++ plugins/opengl/src/paint.cpp 2013-05-08 02:31:48 +0000 @@ -353,6 +353,11 @@ flags |= FullscreenRegion::Desktop; if (w->alpha ()) flags |= FullscreenRegion::Alpha; + + /* Anything which was not occlusion detected is not a suitable + * candidate for unredirection either */ + if (!status) + flags |= FullscreenRegion::NoOcclusionDetection; CompositeWindow *cw = CompositeWindow::get (w);