Merge lp:~compiz-team/compiz-grid-plugin/compiz-grid-plugin.fix_850985 into lp:compiz-grid-plugin

Proposed by Sam Spilsbury
Status: Merged
Merged at revision: 93
Proposed branch: lp:~compiz-team/compiz-grid-plugin/compiz-grid-plugin.fix_850985
Merge into: lp:compiz-grid-plugin
Diff against target: 151 lines (+27/-21)
2 files modified
src/grid.cpp (+25/-19)
src/grid.h (+2/-2)
To merge this branch: bzr merge lp:~compiz-team/compiz-grid-plugin/compiz-grid-plugin.fix_850985
Reviewer Review Type Date Requested Status
Jason Smith (community) Approve
Review via email: mp+75564@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Jason Smith (jassmith) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/grid.cpp'
2--- src/grid.cpp 2011-09-14 03:00:16 +0000
3+++ src/grid.cpp 2011-09-15 15:27:34 +0000
4@@ -119,7 +119,8 @@
5 CompAction::State state,
6 CompOption::Vector &option,
7 GridType where,
8- bool resize)
9+ bool resize,
10+ bool key)
11 {
12 Window xid;
13 CompWindow *cw = 0;
14@@ -138,6 +139,8 @@
15
16 if (gw->lastTarget != where)
17 gw->resizeCount = 0;
18+ else if (!key)
19+ return false;
20
21 props = gridProps[where];
22
23@@ -515,6 +518,7 @@
24 {
25 CompOutput out;
26 CompWindow *w;
27+ bool check = false;
28
29 screen->handleEvent (event);
30
31@@ -568,7 +572,7 @@
32 if (cScreen)
33 cScreen->damageRegion (desiredSlot);
34
35- initiateCommon (0, 0, o, edgeToGridType (), false);
36+ initiateCommon (0, 0, o, edgeToGridType (), false, false);
37
38 if (cScreen)
39 cScreen->damageRegion (desiredSlot);
40@@ -586,7 +590,7 @@
41 if (cScreen)
42 cScreen->damageRegion (desiredSlot);
43
44- initiateCommon (0, 0, o, edgeToGridType (), false);
45+ check = initiateCommon (0, 0, o, edgeToGridType (), false, false);
46
47 if (cScreen)
48 cScreen->damageRegion (desiredSlot);
49@@ -597,7 +601,7 @@
50 /* Begin fading previous animation instance */
51 animations.at (animations.size () - 1).fadingOut = true;
52
53- if (edge != NoEdge)
54+ if (edge != NoEdge && check)
55 {
56 CompWindow *cw = screen->findWindow (screen->activeWindow ());
57 animations.push_back (Animation ());
58@@ -645,7 +649,6 @@
59 {
60 if (screen->grabExist ("move"))
61 {
62- gScreen->o.push_back (CompOption ("window", CompOption::TypeInt));
63 gScreen->o[0].value ().set ((int) window->id ());
64
65 screen->handleEventSetEnabled (gScreen, true);
66@@ -673,7 +676,8 @@
67 if (window == gScreen->mGrabWindow)
68 {
69 gScreen->initiateCommon
70- (0, 0, gScreen->o, gScreen->edgeToGridType (), true);
71+ (0, 0, gScreen->o, gScreen->edgeToGridType (), true,
72+ gScreen->edge != gScreen->lastResizeEdge);
73
74 screen->handleEventSetEnabled (gScreen, false);
75 gScreen->mGrabWindow = NULL;
76@@ -681,6 +685,7 @@
77 gScreen->cScreen->damageRegion (gScreen->desiredSlot);
78 }
79
80+ gScreen->lastResizeEdge = gScreen->edge;
81 gScreen->edge = NoEdge;
82
83 window->ungrabNotify ();
84@@ -834,31 +839,32 @@
85 mGrabWindow (NULL),
86 animating (false)
87 {
88+ o.push_back (CompOption ("window", CompOption::TypeInt));
89
90 ScreenInterface::setHandler (screen, false);
91 CompositeScreenInterface::setHandler (cScreen, false);
92 GLScreenInterface::setHandler (glScreen, false);
93
94- edge = lastEdge = NoEdge;
95+ edge = lastEdge = lastResizeEdge = NoEdge;
96 currentWorkarea = lastWorkarea = screen->getWorkareaForOutput
97 (screen->outputDeviceForPoint (pointerX, pointerY));
98
99 animations.clear ();
100
101-#define GRIDSET(opt,where,resize) \
102+#define GRIDSET(opt,where,resize,key) \
103 optionSet##opt##Initiate (boost::bind (&GridScreen::initiateCommon, this, \
104- _1, _2, _3, where, resize))
105+ _1, _2, _3, where, resize, key))
106
107- GRIDSET (PutCenterKey, GridCenter, true);
108- GRIDSET (PutLeftKey, GridLeft, true);
109- GRIDSET (PutRightKey, GridRight, true);
110- GRIDSET (PutTopKey, GridTop, true);
111- GRIDSET (PutBottomKey, GridBottom, true);
112- GRIDSET (PutTopleftKey, GridTopLeft, true);
113- GRIDSET (PutToprightKey, GridTopRight, true);
114- GRIDSET (PutBottomleftKey, GridBottomLeft, true);
115- GRIDSET (PutBottomrightKey, GridBottomRight, true);
116- GRIDSET (PutMaximizeKey, GridMaximize, true);
117+ GRIDSET (PutCenterKey, GridCenter, true, true);
118+ GRIDSET (PutLeftKey, GridLeft, true, true);
119+ GRIDSET (PutRightKey, GridRight, true, true);
120+ GRIDSET (PutTopKey, GridTop, true, true);
121+ GRIDSET (PutBottomKey, GridBottom, true, true);
122+ GRIDSET (PutTopleftKey, GridTopLeft, true, true);
123+ GRIDSET (PutToprightKey, GridTopRight, true, true);
124+ GRIDSET (PutBottomleftKey, GridBottomLeft, true, true);
125+ GRIDSET (PutBottomrightKey, GridBottomRight, true, true);
126+ GRIDSET (PutMaximizeKey, GridMaximize, true, true);
127
128 #undef GRIDSET
129
130
131=== modified file 'src/grid.h'
132--- src/grid.h 2011-09-14 03:00:16 +0000
133+++ src/grid.h 2011-09-15 15:27:34 +0000
134@@ -101,7 +101,7 @@
135 CompRect workarea, currentRect, desiredSlot, lastSlot,
136 desiredRect, lastWorkarea, currentWorkarea;
137 GridProps props;
138- Edges edge, lastEdge;
139+ Edges edge, lastEdge, lastResizeEdge;
140 CompOption::Vector o;
141 bool centerCheck;
142 CompWindow *mGrabWindow;
143@@ -111,7 +111,7 @@
144 void setCurrentRect (Animation&);
145
146 bool initiateCommon (CompAction*, CompAction::State,
147- CompOption::Vector&, GridType, bool);
148+ CompOption::Vector&, GridType, bool, bool);
149
150 void glPaintRectangle (const GLScreenPaintAttrib&,
151 const GLMatrix&, CompOutput *);

Subscribers

People subscribed via source and target branches

to all changes: