1
=== modified file 'CMakeLists.txt'
2
Index: compiz-plugins-main-0.9.6/grid/src/grid.cpp
3
===================================================================
4
--- compiz-plugins-main-0.9.6.orig/grid/src/grid.cpp 2011-10-07 20:51:50.544182148 +0800
5
+++ compiz-plugins-main-0.9.6/grid/src/grid.cpp 2011-10-07 20:52:34.088398081 +0800
8
using namespace GridWindowType;
10
-static const GridProps gridProps[] =
28
+static std::map <unsigned int, GridProps> gridProps;
31
GridScreen::handleCompizEvent(const char* plugin,
34
GridScreen::getPaintRectangle (CompRect &cRect)
36
- if (edgeToGridType () != GridUnknown && optionGetDrawIndicator ())
37
+ if (typeToMask (edgeToGridType ()) != GridUnknown && optionGetDrawIndicator ())
40
cRect.setGeometry (0, 0, 0, 0);
42
GridScreen::initiateCommon (CompAction *action,
43
CompAction::State state,
44
CompOption::Vector &option,
51
if (maximizeV && !(cw->actions () & CompWindowActionMaximizeVertMask))
54
- if (where == GridUnknown)
55
+ if (where & GridUnknown)
60
- if (gw->lastTarget != where)
61
+ if (gw->lastTarget & ~(where))
69
- if (where == GridMaximize && resize)
70
+ if ((where & GridMaximize) && resize)
72
/* move the window to the correct output */
73
if (cw == mGrabWindow)
76
/* Special case for left and right, actually vertically maximize
78
- if (where == GridLeft || where == GridRight)
79
+ if (where & GridLeft || where & GridRight)
81
/* First restore the window to its original size */
89
+GridScreen::typeToMask (int t)
96
+ std::vector <GridTypeMask> type =
98
+ { GridWindowType::GridUnknown, 0 },
99
+ { GridWindowType::GridBottomLeft, 1 },
100
+ { GridWindowType::GridBottom, 2 },
101
+ { GridWindowType::GridBottomRight, 3 },
102
+ { GridWindowType::GridLeft, 4 },
103
+ { GridWindowType::GridCenter, 5 },
104
+ { GridWindowType::GridRight, 6 },
105
+ { GridWindowType::GridTopLeft, 7 },
106
+ { GridWindowType::GridTop, 8 },
107
+ { GridWindowType::GridTopRight, 9 },
108
+ { GridWindowType::GridMaximize, 10 }
111
+ for (unsigned int i = 0; i < type.size (); i++)
113
+ GridTypeMask &tm = type[i];
118
+ return GridWindowType::GridUnknown;
122
GridScreen::edgeToGridType ()
129
- ret = (GridType) optionGetLeftEdgeAction ();
130
+ ret = (int) optionGetLeftEdgeAction ();
133
- ret = (GridType) optionGetRightEdgeAction ();
134
+ ret = (int) optionGetRightEdgeAction ();
137
- ret = (GridType) optionGetTopEdgeAction ();
138
+ ret = (int) optionGetTopEdgeAction ();
141
- ret = (GridType) optionGetBottomEdgeAction ();
142
+ ret = (int) optionGetBottomEdgeAction ();
145
- ret = (GridType) optionGetTopLeftCornerAction ();
146
+ ret = (int) optionGetTopLeftCornerAction ();
149
- ret = (GridType) optionGetTopRightCornerAction ();
150
+ ret = (int) optionGetTopRightCornerAction ();
153
- ret = (GridType) optionGetBottomLeftCornerAction ();
154
+ ret = (int) optionGetBottomLeftCornerAction ();
157
- ret = (GridType) optionGetBottomRightCornerAction ();
158
+ ret = (int) optionGetBottomRightCornerAction ();
169
cScreen->damageRegion (desiredSlot);
171
- initiateCommon (0, 0, o, edgeToGridType (), false, false);
172
+ initiateCommon (0, 0, o, typeToMask (edgeToGridType ()), false, false);
175
cScreen->damageRegion (desiredSlot);
178
cScreen->damageRegion (desiredSlot);
180
- check = initiateCommon (0, 0, o, edgeToGridType (), false, false);
181
+ check = initiateCommon (NULL, 0, o, typeToMask (edgeToGridType ()), false, false);
184
cScreen->damageRegion (desiredSlot);
186
if (window == gScreen->mGrabWindow)
188
gScreen->initiateCommon
189
- (0, 0, gScreen->o, gScreen->edgeToGridType (), true,
190
+ (NULL, 0, gScreen->o, gScreen->typeToMask (gScreen->edgeToGridType ()), true,
191
gScreen->edge != gScreen->lastResizeEdge);
193
screen->handleEventSetEnabled (gScreen, false);
195
dx = currentSize.x () - window->geometry ().x ();
196
dy = currentSize.y () - window->geometry ().y ();
198
+ printf ("offset move\n");
200
window->move (dx, dy);
203
@@ -983,6 +1001,17 @@
204
edge = lastEdge = lastResizeEdge = NoEdge;
205
currentWorkarea = lastWorkarea = screen->getWorkareaForOutput
206
(screen->outputDeviceForPoint (pointerX, pointerY));
207
+ gridProps[GridUnknown] = GridProps {0,1, 1,1};
208
+ gridProps[GridBottomLeft] = GridProps {0,1, 2,2};
209
+ gridProps[GridBottom] = GridProps {0,1, 1,2};
210
+ gridProps[GridBottomRight] = GridProps {1,1, 2,2};
211
+ gridProps[GridLeft] = GridProps {0,0, 2,1};
212
+ gridProps[GridCenter] = GridProps{0,0, 1,1};
213
+ gridProps[GridRight] = GridProps {1,0, 2,1};
214
+ gridProps[GridTopLeft] = GridProps{0,0, 2,2};
215
+ gridProps[GridTop] = GridProps {0,0, 1,2};
216
+ gridProps[GridTopRight] = GridProps {0,0, 1,2};
217
+ gridProps[GridMaximize] = GridProps {0,0, 1,1};
221
@@ -990,16 +1019,16 @@
222
optionSet##opt##Initiate (boost::bind (&GridScreen::initiateCommon, this, \
223
_1, _2, _3, where, resize, key))
225
- GRIDSET (PutCenterKey, GridCenter, true, true);
226
- GRIDSET (PutLeftKey, GridLeft, true, true);
227
- GRIDSET (PutRightKey, GridRight, true, true);
228
- GRIDSET (PutTopKey, GridTop, true, true);
229
- GRIDSET (PutBottomKey, GridBottom, true, true);
230
- GRIDSET (PutTopleftKey, GridTopLeft, true, true);
231
- GRIDSET (PutToprightKey, GridTopRight, true, true);
232
- GRIDSET (PutBottomleftKey, GridBottomLeft, true, true);
233
- GRIDSET (PutBottomrightKey, GridBottomRight, true, true);
234
- GRIDSET (PutMaximizeKey, GridMaximize, true, true);
235
+ GRIDSET (PutCenterKey, GridWindowType::GridCenter, true, true);
236
+ GRIDSET (PutLeftKey, GridWindowType::GridLeft, true, true);
237
+ GRIDSET (PutRightKey, GridWindowType::GridRight, true, true);
238
+ GRIDSET (PutTopKey, GridWindowType::GridTop, true, true);
239
+ GRIDSET (PutBottomKey, GridWindowType::GridBottom, true, true);
240
+ GRIDSET (PutTopleftKey, GridWindowType::GridTopLeft, true, true);
241
+ GRIDSET (PutToprightKey, GridWindowType::GridTopRight, true, true);
242
+ GRIDSET (PutBottomleftKey, GridWindowType::GridBottomLeft, true, true);
243
+ GRIDSET (PutBottomrightKey, GridWindowType::GridBottomRight, true, true);
244
+ GRIDSET (PutMaximizeKey, GridWindowType::GridMaximize, true, true);
248
Index: compiz-plugins-main-0.9.6/grid/src/grid.h
249
===================================================================
250
--- compiz-plugins-main-0.9.6.orig/grid/src/grid.h 2011-10-07 20:51:08.995976136 +0800
251
+++ compiz-plugins-main-0.9.6/grid/src/grid.h 2011-10-07 20:52:00.372230883 +0800
253
void setCurrentRect (Animation&);
255
bool initiateCommon (CompAction*, CompAction::State,
256
- CompOption::Vector&, GridType, bool, bool);
257
+ CompOption::Vector&, unsigned int, bool, bool);
259
void glPaintRectangle (const GLScreenPaintAttrib&,
260
const GLMatrix&, CompOutput *);
263
std::vector <Animation> animations;
265
- GridType edgeToGridType ();
266
+ int edgeToGridType ();
267
+ unsigned int typeToMask (int);
269
void handleEvent (XEvent *event);
270
void handleCompizEvent (const char *plugin, const char *event, CompOption::Vector &options);