Merge lp:~mc-return/compiz/compiz.merge-fix1068173-grid-does-not-follow-preview into lp:compiz/0.9.9

Proposed by MC Return on 2012-10-24
Status: Merged
Approved by: Daniel van Vugt on 2012-11-05
Approved revision: 3441
Merged at revision: 3448
Proposed branch: lp:~mc-return/compiz/compiz.merge-fix1068173-grid-does-not-follow-preview
Merge into: lp:compiz/0.9.9
Diff against target: 51 lines (+17/-17)
1 file modified
plugins/grid/src/grid.cpp (+17/-17)
To merge this branch: bzr merge lp:~mc-return/compiz/compiz.merge-fix1068173-grid-does-not-follow-preview
Reviewer Review Type Date Requested Status
Daniel van Vugt Approve on 2012-11-05
Sam Spilsbury 2012-10-24 Approve on 2012-10-26
PS Jenkins bot continuous-integration Pending
Review via email: mp+131227@code.launchpad.net

Commit message

Check on which display your pointer is at, before calculating edges/corners for the snap preview.

The problem here is that detection (if the cursor enters another output) is done after the trigger edges have already been detected and calculated, so if you enter a new screen the preview will still have the old values and not follow the mousepointer to the new monitor. Then if you release the mousebutton the resize won't follow the preview, but resize correctly on the monitor your cursor is currently at, while still showing the old preview.

(LP: #1068173)

To post a comment you must log in.
Sam Spilsbury (smspillaz) wrote :

This looks fine to me, any thoughts Daniel?

review: Approve
Daniel van Vugt (vanvugt) wrote :

I'm not familiar with the affected code, but it looks straightforward and testing with two monitors I can confirm it fixes the bug.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/grid/src/grid.cpp'
2--- plugins/grid/src/grid.cpp 2012-10-18 11:05:40 +0000
3+++ plugins/grid/src/grid.cpp 2012-10-24 15:45:52 +0000
4@@ -695,6 +695,23 @@
5 if (event->type != MotionNotify || !mGrabWindow)
6 return;
7
8+ /* Detect when cursor enters another output */
9+
10+ currentWorkarea = screen->getWorkareaForOutput
11+ (screen->outputDeviceForPoint (pointerX, pointerY));
12+ if (lastWorkarea != currentWorkarea)
13+ {
14+ lastWorkarea = currentWorkarea;
15+
16+ if (cScreen)
17+ cScreen->damageRegion (desiredSlot);
18+
19+ initiateCommon (0, 0, o, typeToMask (edgeToGridType ()), false, false);
20+
21+ if (cScreen)
22+ cScreen->damageRegion (desiredSlot);
23+ }
24+
25 out = screen->outputDevs ().at (
26 screen->outputDeviceForPoint (CompPoint (pointerX, pointerY)));
27
28@@ -731,23 +748,6 @@
29 else
30 edge = NoEdge;
31
32- /* Detect when cursor enters another output */
33-
34- currentWorkarea = screen->getWorkareaForOutput
35- (screen->outputDeviceForPoint (pointerX, pointerY));
36- if (lastWorkarea != currentWorkarea)
37- {
38- lastWorkarea = currentWorkarea;
39-
40- if (cScreen)
41- cScreen->damageRegion (desiredSlot);
42-
43- initiateCommon (0, 0, o, typeToMask (edgeToGridType ()), false, false);
44-
45- if (cScreen)
46- cScreen->damageRegion (desiredSlot);
47- }
48-
49 /* Detect edge region change */
50
51 if (lastEdge != edge)

Subscribers

People subscribed via source and target branches