Merge lp:~townsend/compiz/fix-minimize-unredirect-window-0.9.9 into lp:compiz/0.9.9

Proposed by Christopher Townsend on 2013-05-09
Status: Merged
Approved by: Marco Trevisan (Treviño) on 2013-05-13
Approved revision: 3654
Merged at revision: 3654
Proposed branch: lp:~townsend/compiz/fix-minimize-unredirect-window-0.9.9
Merge into: lp:compiz/0.9.9
Diff against target: 71 lines (+27/-2)
4 files modified
plugins/opengl/src/fsregion/fsregion.cpp (+1/-1)
plugins/opengl/src/fsregion/fsregion.h (+2/-1)
plugins/opengl/src/fsregion/tests/test-fsregion.cpp (+19/-0)
plugins/opengl/src/paint.cpp (+5/-0)
To merge this branch: bzr merge lp:~townsend/compiz/fix-minimize-unredirect-window-0.9.9
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve on 2013-05-13
Marco Trevisan (Treviño) 2013-05-09 Approve on 2013-05-13
Review via email: mp+163162@code.launchpad.net

Commit message

Fixed issue where minimizing an unredirect full screen window would repaint the full screen window after minimizing it even though it isn't really there. This is a backport of lp:compiz revno. 3686.

Description of the change

Note: This is a backport of lp:compiz revno. 3686.

= Issue =
Minimizing an unredirect full screen window will display the full screen window after the minimization even though it isn't really there.

= Fix =
Do not unredirect a full screen window if no occlusion is detected meaning that it has been minimized.

= Test =
Added some unit test coverage with Sam's guidance.

To post a comment you must log in.
Sam Spilsbury (smspillaz) wrote :

I've filed bug https://bugs.launchpad.net/compiz/+bug/1178514 about the failing tests. Its not an issue here specifically.

Marco Trevisan (Treviño) (3v1n0) wrote :

+1

review: Approve
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/opengl/src/fsregion/fsregion.cpp'
2--- plugins/opengl/src/fsregion/fsregion.cpp 2012-11-29 10:51:38 +0000
3+++ plugins/opengl/src/fsregion/fsregion.cpp 2013-05-09 15:31:55 +0000
4@@ -48,7 +48,7 @@
5 {
6 bool fullscreen = false;
7
8- if (!(flags & (Desktop | Alpha)) &&
9+ if (!(flags & (Desktop | Alpha | NoOcclusionDetection)) &&
10 region == untouched &&
11 region == orig)
12 {
13
14=== modified file 'plugins/opengl/src/fsregion/fsregion.h'
15--- plugins/opengl/src/fsregion/fsregion.h 2012-11-29 10:51:38 +0000
16+++ plugins/opengl/src/fsregion/fsregion.h 2013-05-09 15:31:55 +0000
17@@ -37,7 +37,8 @@
18 typedef enum
19 {
20 Desktop = 1,
21- Alpha = 2
22+ Alpha = 2,
23+ NoOcclusionDetection = 3
24 } WinFlag;
25
26 typedef unsigned int WinFlags;
27
28=== modified file 'plugins/opengl/src/fsregion/tests/test-fsregion.cpp'
29--- plugins/opengl/src/fsregion/tests/test-fsregion.cpp 2012-11-29 10:51:38 +0000
30+++ plugins/opengl/src/fsregion/tests/test-fsregion.cpp 2013-05-09 15:31:55 +0000
31@@ -68,6 +68,25 @@
32 FullscreenRegion::Desktop));
33 }
34
35+TEST (OpenGLFullscreenRegion, NoOcclusionFullscreen)
36+{
37+ FullscreenRegion monitor (CompRect (0, 0, 1024, 768));
38+ EXPECT_FALSE (monitor.isCoveredBy (CompRegion (0, 0, 1024, 768),
39+ FullscreenRegion::NoOcclusionDetection));
40+ EXPECT_FALSE (monitor.isCoveredBy (CompRegion (0, 0, 1024, 768),
41+ FullscreenRegion::Desktop));
42+}
43+
44+TEST (OpenGLFullscreenRegion, NoOcclusionOverFullscreen)
45+{
46+ FullscreenRegion monitor (CompRect (0, 0, 1024, 768));
47+ EXPECT_FALSE (monitor.isCoveredBy (CompRegion (50, 60, 70, 80),
48+ FullscreenRegion::NoOcclusionDetection));
49+ EXPECT_FALSE (monitor.isCoveredBy (CompRegion (0, 0, 1024, 768)));
50+ EXPECT_FALSE (monitor.isCoveredBy (CompRegion (0, 0, 1024, 768),
51+ FullscreenRegion::Desktop));
52+}
53+
54 TEST (OpenGLFullscreenRegion, NormalWindows)
55 {
56 FullscreenRegion monitor (CompRect (0, 0, 1024, 768));
57
58=== modified file 'plugins/opengl/src/paint.cpp'
59--- plugins/opengl/src/paint.cpp 2013-01-03 16:05:26 +0000
60+++ plugins/opengl/src/paint.cpp 2013-05-09 15:31:55 +0000
61@@ -353,6 +353,11 @@
62 flags |= FullscreenRegion::Desktop;
63 if (w->alpha ())
64 flags |= FullscreenRegion::Alpha;
65+
66+ /* Anything which was not occlusion detected is not a suitable
67+ * candidate for unredirection either */
68+ if (!status)
69+ flags |= FullscreenRegion::NoOcclusionDetection;
70
71 CompositeWindow *cw = CompositeWindow::get (w);
72

Subscribers

People subscribed via source and target branches