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

« back to all changes in this revision

Viewing changes to debian/patches/fix-865177-865179.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/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
 
6
@@ -214,7 +214,13 @@
 
7
        desiredSlot.setWidth (workarea.width () / props.numCellsX);
 
8
 
 
9
        /* Adjust for constraints and decorations */
 
10
-       desiredRect = constrainSize (cw, desiredSlot);
 
11
+       if (where & ~(GridMaximize | GridLeft | GridRight))
 
12
+       {
 
13
+           desiredRect = constrainSize (cw, desiredSlot);
 
14
+       }
 
15
+       else
 
16
+           desiredRect = slotToRect (cw, desiredSlot);
 
17
+
 
18
        /* Get current rect not including decorations */
 
19
        currentRect.setGeometry (cw->serverX (), cw->serverY (),
 
20
                                 cw->serverWidth (),
 
21
@@ -338,6 +344,9 @@
 
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 ();
 
26
+
 
27
+           gw->sizeHintsFlags = 0;
 
28
 
 
29
            /* Special case for left and right, actually vertically maximize
 
30
             * the window */
 
31
@@ -356,7 +365,6 @@
 
32
                gw->isGridMaximized = true;
 
33
                gw->isGridResized = false;
 
34
 
 
35
-               gw->lastBorder = cw->border ();
 
36
                /* Maximize the window */
 
37
                cw->maximize (CompWindowStateMaximizedVertMask);
 
38
                /* Be evil */
 
39
@@ -372,6 +380,17 @@
 
40
                gw->isGridMaximized = false;
 
41
            }
 
42
 
 
43
+           int dw = (lastBorder.left + lastBorder.right) - 
 
44
+                     (gw->window->border ().left +
 
45
+                      gw->window->border ().right);
 
46
+                       
 
47
+           int dh = (lastBorder.top + lastBorder.bottom) - 
 
48
+                       (gw->window->border ().top +
 
49
+                        gw->window->border ().bottom);
 
50
+
 
51
+           xwc.width += dw;
 
52
+           xwc.height += dh;
 
53
+
 
54
            /* Make window the size that we want */
 
55
            cw->configureXWindow (valueMask, &xwc);
 
56
 
 
57
@@ -723,6 +742,21 @@
 
58
 }
 
59
 
 
60
 void
 
61
+GridWindow::validateResizeRequest (unsigned int &xwcm,
 
62
+                                  XWindowChanges *xwc,
 
63
+                                  unsigned int source)
 
64
+{
 
65
+    window->validateResizeRequest (xwcm, xwc, source);
 
66
+
 
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)
 
72
+           xwcm = 0;
 
73
+}
 
74
+
 
75
+void
 
76
 GridWindow::grabNotify (int          x,
 
77
                        int          y,
 
78
                        unsigned int state,
 
79
@@ -792,8 +826,6 @@
 
80
        dx = currentSize.x () - window->geometry ().x ();
 
81
        dy = currentSize.y () - window->geometry ().y ();
 
82
 
 
83
-       printf ("offset move\n");
 
84
-
 
85
        window->move (dx, dy);
 
86
     }
 
87
 }
 
88
@@ -818,37 +850,6 @@
 
89
     window->stateChangeNotify (lastState);
 
90
 }
 
91
 
 
92
-void
 
93
-GridWindow::windowNotify (CompWindowNotify n)
 
94
-{
 
95
-    if (n == CompWindowNotifyFrameUpdate)
 
96
-    {
 
97
-       if (isGridMaximized && !((window->state () & MAXIMIZE_STATE) == MAXIMIZE_STATE))
 
98
-       {
 
99
-           unsigned int valueMask = 0;
 
100
-           XWindowChanges xwc;
 
101
-
 
102
-           int dw = (lastBorder.left + lastBorder.right) - 
 
103
-                     (window->border ().left + window->border ().right);
 
104
-                       
 
105
-           int dh = (lastBorder.top + lastBorder.bottom) - 
 
106
-                       (window->border ().top + window->border ().bottom);
 
107
-
 
108
-           if (dw != 0)
 
109
-               valueMask |= CWWidth;
 
110
-           if (dh != 0)
 
111
-               valueMask |= CWHeight;
 
112
-           xwc.width = window->serverGeometry ().width () + dw;
 
113
-           xwc.height = window->serverGeometry ().height () + dh;
 
114
-
 
115
-           window->configureXWindow (valueMask, &xwc);
 
116
-       }
 
117
-
 
118
-       lastBorder = window->border ();
 
119
-    }
 
120
-
 
121
-    window->windowNotify (n);
 
122
-}
 
123
 bool
 
124
 GridScreen::restoreWindow (CompAction         *action,
 
125
                           CompAction::State  state,
 
126
@@ -866,7 +867,10 @@
 
127
        return false;
 
128
 
 
129
     if (gw->isGridMaximized & !(cw->state () & MAXIMIZE_STATE))
 
130
-           gw->isGridMaximized = false;
 
131
+    {
 
132
+       gw->window->sizeHints ().flags |= gw->sizeHintsFlags;
 
133
+       gw->isGridMaximized = false;
 
134
+    }
 
135
     else
 
136
     {
 
137
         if (cw == mGrabWindow)
 
138
@@ -1049,7 +1053,7 @@
 
139
     grabMask (0),
 
140
     pointerBufDx (0),
 
141
     pointerBufDy (0),
 
142
-    resizeCount (0),
 
143
+    resizeCount (0),   
 
144
     lastTarget (GridUnknown)
 
145
 {
 
146
     WindowInterface::setHandler (window);