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
7
screen->vp ().y () - selectedVp.y (), true);
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)
14
dndWindow->saveWc ().x = dndWindow->saveWc ().x % screen->width ();
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);
26
+ dndWindows.clear ();
32
expoCam = MAX (0.0, expoCam - val);
34
- if (dndState == DnDDuring)
36
- foreach (CompWindow *w, dndWindows)
37
- ExpoWindow::get (w)->dndOpacity = MIN (1.0, ExpoWindow::get (w)->dndOpacity + val);
39
- else if (dndState == DnDNone)
41
- CompWindowList::iterator it = dndWindows.begin ();
43
- while (it != dndWindows.end ())
45
- ExpoWindow::get ((*it))->dndOpacity = MAX (0.0, ExpoWindow::get ((*it))->dndOpacity - val);
47
- if (ExpoWindow::get ((*it))->dndOpacity <= 0.0f)
49
- dndWindows.erase (it);
50
- it = dndWindows.begin ();
59
unsigned int i, j, vp;
61
foreach (float& vp, vpActivity)
62
if (vp != 0.0 && vp != 1.0)
63
cScreen->damageScreen ();
65
- foreach (CompWindow *w, dndWindows)
66
- if (ExpoWindow::get (w)->dndOpacity != 0.0f &&
67
- ExpoWindow::get (w)->dndOpacity != 1.0f)
68
- cScreen->damageScreen ();
71
if (grabIndex && expoCam <= 0.0f && !expoMode)
73
screen->removeGrab (grabIndex, NULL);
76
+ cScreen->damageScreen ();
79
cScreen->donePaint ();
84
- dndWindows.push_back (w);
86
+ if (std::find (dndWindows.begin (), dndWindows.end (), w) == dndWindows.end ())
87
+ dndWindows.push_back (w);
89
w->grabNotify (nx, ny, 0,
90
CompWindowGrabMoveMask |
94
cScreen->getWindowPaintListSetEnabled (this, paintingDndWindow);
96
gScreen->glPaintTransformedOutput (attrib, sTransform3,
97
screen->region (), output,
101
vp.setY (screen->vpSize ().height () + vp.y ());
103
- paintViewport (attrib, sTransform, infiniteRegion, output, mask, vp, vpCamPos, reflection);
104
+ paintViewport (attrib, sTransform, region, output, mask, vp, vpCamPos, reflection);
107
paintingDndWindow = false;
108
@@ -1228,7 +1204,7 @@
112
- if (vp == eScreen->paintingVp || window->onAllViewports ())
113
+ if ((vp == eScreen->paintingVp || window->onAllViewports ()) && !eScreen->paintingDndWindow)
115
fA.setBrightness (fragment.getBrightness () * eScreen->vpBrightness);
116
fA.setSaturation (fragment.getSaturation () * eScreen->vpSaturation);
117
@@ -1316,7 +1292,6 @@
125
@@ -1463,6 +1438,7 @@
126
GLMatrix wTransform (transform);
127
GLWindowPaintAttrib wAttrib (attrib);
129
+ CompRegion clip (region);
131
screen->viewportForGeometry (window->geometry (), vp);
133
@@ -1505,6 +1481,7 @@
135
/* Stretch maximized windows a little so that you don't
136
* have an awkward gap */
138
if (window->state () & MAXIMIZE_STATE)
140
CompOutput *o = &screen->outputDevs ()[screen->outputDeviceForGeometry(window->geometry())];
141
@@ -1522,27 +1499,21 @@
143
mask |= PAINT_WINDOW_TRANSFORMED_MASK;
147
if (std::find (eScreen->dndWindows.begin(), eScreen->dndWindows.end (), window) != eScreen->dndWindows.end ())
149
if (!eScreen->paintingDndWindow)
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;
161
mask |= PAINT_WINDOW_TRANSFORMED_MASK;
162
- if (!window->region ().subtracted (screen->region ()).isEmpty ())
163
- wAttrib.opacity = wAttrib.opacity * dndOpacity;
164
+ clip = infiniteRegion;
168
- bool status = gWindow->glPaint (wAttrib, wTransform, region, mask);
169
+ bool status = gWindow->glPaint (wAttrib, wTransform, clip, mask);
173
@@ -1661,7 +1632,6 @@
174
cWindow (CompositeWindow::get (w)),
175
gWindow (GLWindow::get (w)),
176
eScreen (ExpoScreen::get (screen)),
180
CompositeWindowInterface::setHandler (cWindow, false);