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

« back to all changes in this revision

Viewing changes to debian/patches/fix-853951.patch

  • Committer: Sam Spilsbury
  • Date: 2011-10-07 16:09:42 UTC
  • Revision ID: sam.spilsbury@canonical.com-20111007160942-9zkw97vowa95galq
Added some new patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
=== modified file 'src/expo.cpp'
 
2
Index: compiz-plugins-main-0.9.6/expo/src/expo.cpp
 
3
===================================================================
 
4
--- compiz-plugins-main-0.9.6.orig/expo/src/expo.cpp    2011-10-04 01:21:03.253549136 +0800
 
5
+++ compiz-plugins-main-0.9.6/expo/src/expo.cpp 2011-10-04 01:21:22.253643351 +0800
 
6
@@ -274,7 +274,7 @@
 
7
                                  screen->vp ().y () - selectedVp.y (), true);
 
8
 
 
9
            /* update saved window attributes in case we moved the
 
10
-    window to a new viewport */
 
11
+              window to a new viewport */
 
12
            if (dndWindow->saveMask () & CWX)
 
13
            {
 
14
                dndWindow->saveWc ().x = dndWindow->saveWc ().x % screen->width ();
 
15
@@ -289,11 +289,13 @@
 
16
            }
 
17
 
 
18
            /* update window attibutes to make sure a moved maximized window
 
19
-          is properly snapped to the work area */
 
20
+              is properly snapped to the work area */
 
21
            if (dndWindow->state () & MAXIMIZE_STATE)
 
22
                dndWindow->updateAttributes (CompStackingUpdateModeNone);
 
23
        }
 
24
     }
 
25
+
 
26
+    dndWindows.clear ();
 
27
 }
 
28
 
 
29
 void
 
30
@@ -394,29 +396,6 @@
 
31
     else
 
32
        expoCam = MAX (0.0, expoCam - val);
 
33
 
 
34
-    if (dndState == DnDDuring)
 
35
-    {
 
36
-       foreach (CompWindow *w, dndWindows)
 
37
-           ExpoWindow::get (w)->dndOpacity = MIN (1.0, ExpoWindow::get (w)->dndOpacity + val);
 
38
-    }
 
39
-    else if (dndState == DnDNone)
 
40
-    {
 
41
-       CompWindowList::iterator it = dndWindows.begin ();
 
42
-
 
43
-       while (it != dndWindows.end ())
 
44
-       {
 
45
-           ExpoWindow::get ((*it))->dndOpacity = MAX (0.0, ExpoWindow::get ((*it))->dndOpacity - val);
 
46
-
 
47
-           if (ExpoWindow::get ((*it))->dndOpacity <= 0.0f)
 
48
-           {
 
49
-               dndWindows.erase (it);
 
50
-               it = dndWindows.begin ();
 
51
-           }
 
52
-           else
 
53
-               it++;
 
54
-       }
 
55
-    }
 
56
-
 
57
     if (expoCam)
 
58
     {
 
59
        unsigned int i, j, vp;
 
60
@@ -545,11 +524,6 @@
 
61
        foreach (float& vp, vpActivity)
 
62
            if (vp != 0.0 && vp != 1.0)
 
63
                cScreen->damageScreen ();
 
64
-
 
65
-       foreach (CompWindow *w, dndWindows)
 
66
-           if (ExpoWindow::get (w)->dndOpacity != 0.0f &&
 
67
-               ExpoWindow::get (w)->dndOpacity != 1.0f)
 
68
-               cScreen->damageScreen ();
 
69
     }
 
70
 
 
71
     if (grabIndex && expoCam <= 0.0f && !expoMode)
 
72
@@ -557,6 +531,7 @@
 
73
        screen->removeGrab (grabIndex, NULL);
 
74
        grabIndex = 0;
 
75
        updateWraps (false);
 
76
+       cScreen->damageScreen ();
 
77
     }
 
78
 
 
79
     cScreen->donePaint ();
 
80
@@ -640,7 +615,9 @@
 
81
                    break;
 
82
 
 
83
                dndState  = DnDDuring;
 
84
-               dndWindows.push_back (w);
 
85
+
 
86
+               if (std::find (dndWindows.begin (), dndWindows.end (), w) == dndWindows.end ())
 
87
+                   dndWindows.push_back (w);
 
88
 
 
89
                w->grabNotify (nx, ny, 0,
 
90
                               CompWindowGrabMoveMask |
 
91
@@ -808,7 +785,6 @@
 
92
     }
 
93
 
 
94
     cScreen->getWindowPaintListSetEnabled (this, paintingDndWindow);
 
95
-
 
96
     gScreen->glPaintTransformedOutput (attrib, sTransform3,
 
97
                                       screen->region (), output,
 
98
                                       mask);
 
99
@@ -1053,7 +1029,7 @@
 
100
        while (vp.y () < 0)
 
101
            vp.setY (screen->vpSize ().height () + vp.y ());
 
102
 
 
103
-       paintViewport (attrib, sTransform, infiniteRegion, output, mask, vp, vpCamPos, reflection);
 
104
+       paintViewport (attrib, sTransform, region, output, mask, vp, vpCamPos, reflection);
 
105
     }
 
106
 
 
107
     paintingDndWindow = false;
 
108
@@ -1228,7 +1204,7 @@
 
109
            }
 
110
        }
 
111
 
 
112
-       if (vp == eScreen->paintingVp || window->onAllViewports ())
 
113
+       if ((vp == eScreen->paintingVp || window->onAllViewports ()) && !eScreen->paintingDndWindow)
 
114
        {
 
115
            fA.setBrightness (fragment.getBrightness () * eScreen->vpBrightness);
 
116
            fA.setSaturation (fragment.getSaturation () * eScreen->vpSaturation);
 
117
@@ -1316,7 +1292,6 @@
 
118
        }
 
119
 
 
120
   }
 
121
-
 
122
   return status;
 
123
 
 
124
 }
 
125
@@ -1463,6 +1438,7 @@
 
126
     GLMatrix            wTransform (transform);
 
127
     GLWindowPaintAttrib wAttrib (attrib);
 
128
     CompPoint           vp;
 
129
+    CompRegion          clip (region);
 
130
 
 
131
     screen->viewportForGeometry (window->geometry (), vp);
 
132
 
 
133
@@ -1505,6 +1481,7 @@
 
134
 
 
135
     /* Stretch maximized windows a little so that you don't
 
136
      * have an awkward gap */
 
137
+
 
138
     if (window->state () & MAXIMIZE_STATE)
 
139
     {
 
140
        CompOutput *o = &screen->outputDevs ()[screen->outputDeviceForGeometry(window->geometry())];
 
141
@@ -1522,27 +1499,21 @@
 
142
 
 
143
        mask |= PAINT_WINDOW_TRANSFORMED_MASK;
 
144
     }
 
145
-
 
146
+       
 
147
     if (std::find (eScreen->dndWindows.begin(), eScreen->dndWindows.end (), window) != eScreen->dndWindows.end ())
 
148
     {
 
149
        if (!eScreen->paintingDndWindow)
 
150
        {
 
151
-           if ((1.0f - dndOpacity) <= 0.0f || (eScreen->paintingVp == vp &&
 
152
-                                               eScreen->dndState != ExpoScreen::DnDNone))
 
153
-               mask |= PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
 
154
-           else if (!window->region ().subtracted (screen->region ()).isEmpty () &&
 
155
-                    eScreen->paintingVp != vp)
 
156
-               wAttrib.opacity = wAttrib.opacity * (1.0f - dndOpacity);
 
157
+           mask |= PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
 
158
        }
 
159
        else
 
160
        {
 
161
            mask |= PAINT_WINDOW_TRANSFORMED_MASK;
 
162
-           if (!window->region ().subtracted (screen->region ()).isEmpty ())
 
163
-               wAttrib.opacity = wAttrib.opacity * dndOpacity;
 
164
+           clip = infiniteRegion;
 
165
        }
 
166
     }
 
167
 
 
168
-    bool status = gWindow->glPaint (wAttrib, wTransform, region, mask);
 
169
+    bool status = gWindow->glPaint (wAttrib, wTransform, clip, mask);
 
170
 
 
171
     return status;
 
172
 }
 
173
@@ -1661,7 +1632,6 @@
 
174
     cWindow (CompositeWindow::get (w)),
 
175
     gWindow (GLWindow::get (w)),
 
176
     eScreen (ExpoScreen::get (screen)),
 
177
-    dndOpacity (0.0f),
 
178
     mGlowQuads (NULL)
 
179
 {
 
180
     CompositeWindowInterface::setHandler (cWindow, false);