~linaro-maintainers/compiz-plugins-main/overlay-gl

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
--- a/workarounds/src/workarounds.cpp	2012-02-21 03:51:25 +0000
+++ b/workarounds/src/workarounds.cpp	2012-02-24 08:54:19 +0000
@@ -299,6 +299,17 @@
     return gWindow->glPaint (attrib, transform, region, mask);
 }
 
+bool
+WorkaroundsWindow::damageRect (bool initial, const CompRect &rect)
+{
+    if (initial)
+	cWindow->addDamage (true);
+
+    cWindow->damageRectSetEnabled (this, false);
+
+    return cWindow->damageRect (initial, rect);
+}
+
 void
 WorkaroundsScreen::checkFunctions (bool checkWindow, bool checkScreen)
 {
@@ -1075,6 +1086,9 @@
 
     WORKAROUNDS_SCREEN (screen);
 
+    if (ws->optionGetInitialDamageCompleteRedraw ())
+	CompositeWindowInterface::setHandler (cWindow);
+
     if (ws->optionGetLegacyFullscreen ())
     {
 	window->getAllowedActionsSetEnabled (this, false);

--- a/workarounds/src/workarounds.h	2012-01-13 00:14:05 +0000
+++ b/workarounds/src/workarounds.h	2012-02-24 08:54:19 +0000
@@ -122,6 +122,7 @@
 class WorkaroundsWindow :
     public PluginClassHandler <WorkaroundsWindow, CompWindow>,
     public WindowInterface,
+    public CompositeWindowInterface,
     public GLWindowInterface
 {
     public:
@@ -200,6 +201,9 @@
 	unsigned int
 	getFixedWindowType ();
 
+	bool
+	damageRect (bool initial, const CompRect &rect);
+
 };
 
 #define WORKAROUNDS_WINDOW(w)						       \

--- a/workarounds/workarounds.xml.in	2012-01-13 00:14:05 +0000
+++ b/workarounds/workarounds.xml.in	2012-02-24 08:54:19 +0000
@@ -83,6 +83,11 @@
 		<_long>Don't wait for the next video sync time to redraw</_long>
 		<default>false</default>
 	    </option>
+	    <option type="bool" name="initial_damage_complete_redraw">
+		<_short>Force complete redraw on initial damage</_short>
+		<_long>Force complete redraw of the window on initial damage event</_long>
+		<default>true</default>
+	    </option>
 	    <option type="bool" name="force_swap_buffers">
 		<_short>Force full screen redraws (buffer swap) on repaint</_short>
 		<_long>Forces the entire screen to redraw every repaint. Use with care, this will cause a massive increase in GPU and CPU usage</_long>