1
=== modified file 'src/grid.cpp'
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-08 00:04:28.801496451 +0800
5
+++ compiz-plugins-main-0.9.6/grid/src/grid.cpp 2011-10-08 00:06:13.290014587 +0800
7
desiredSlot.setWidth (workarea.width () / props.numCellsX);
9
/* Adjust for constraints and decorations */
10
- desiredRect = constrainSize (cw, desiredSlot);
11
+ if (where & ~(GridMaximize | GridLeft | GridRight))
13
+ desiredRect = constrainSize (cw, desiredSlot);
16
+ desiredRect = slotToRect (cw, desiredSlot);
18
/* Get current rect not including decorations */
19
currentRect.setGeometry (cw->serverX (), cw->serverY (),
22
unsigned int valueMask = CWX | CWY | CWWidth | CWHeight;
23
gw->lastTarget = where;
24
gw->currentSize = CompRect (wc.x, wc.y, wc.width, wc.height);
25
+ CompWindowExtents lastBorder = gw->window->border ();
27
+ gw->sizeHintsFlags = 0;
29
/* Special case for left and right, actually vertically maximize
32
gw->isGridMaximized = true;
33
gw->isGridResized = false;
35
- gw->lastBorder = cw->border ();
36
/* Maximize the window */
37
cw->maximize (CompWindowStateMaximizedVertMask);
40
gw->isGridMaximized = false;
43
+ int dw = (lastBorder.left + lastBorder.right) -
44
+ (gw->window->border ().left +
45
+ gw->window->border ().right);
47
+ int dh = (lastBorder.top + lastBorder.bottom) -
48
+ (gw->window->border ().top +
49
+ gw->window->border ().bottom);
54
/* Make window the size that we want */
55
cw->configureXWindow (valueMask, &xwc);
61
+GridWindow::validateResizeRequest (unsigned int &xwcm,
62
+ XWindowChanges *xwc,
63
+ unsigned int source)
65
+ window->validateResizeRequest (xwcm, xwc, source);
67
+ /* Don't allow non-pagers to change
68
+ * the size of the window, the user
69
+ * specified this size, thank-you */
70
+ if (isGridMaximized)
71
+ if (source != ClientTypePager)
76
GridWindow::grabNotify (int x,
80
dx = currentSize.x () - window->geometry ().x ();
81
dy = currentSize.y () - window->geometry ().y ();
83
- printf ("offset move\n");
85
window->move (dx, dy);
89
window->stateChangeNotify (lastState);
93
-GridWindow::windowNotify (CompWindowNotify n)
95
- if (n == CompWindowNotifyFrameUpdate)
97
- if (isGridMaximized && !((window->state () & MAXIMIZE_STATE) == MAXIMIZE_STATE))
99
- unsigned int valueMask = 0;
100
- XWindowChanges xwc;
102
- int dw = (lastBorder.left + lastBorder.right) -
103
- (window->border ().left + window->border ().right);
105
- int dh = (lastBorder.top + lastBorder.bottom) -
106
- (window->border ().top + window->border ().bottom);
109
- valueMask |= CWWidth;
111
- valueMask |= CWHeight;
112
- xwc.width = window->serverGeometry ().width () + dw;
113
- xwc.height = window->serverGeometry ().height () + dh;
115
- window->configureXWindow (valueMask, &xwc);
118
- lastBorder = window->border ();
121
- window->windowNotify (n);
124
GridScreen::restoreWindow (CompAction *action,
125
CompAction::State state,
129
if (gw->isGridMaximized & !(cw->state () & MAXIMIZE_STATE))
130
- gw->isGridMaximized = false;
132
+ gw->window->sizeHints ().flags |= gw->sizeHintsFlags;
133
+ gw->isGridMaximized = false;
137
if (cw == mGrabWindow)
138
@@ -1049,7 +1053,7 @@
144
lastTarget (GridUnknown)
146
WindowInterface::setHandler (window);