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

Proposed by MC Return
Status: Merged
Approved by: Daniel van Vugt
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
Sam Spilsbury Approve
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.
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

This looks fine to me, any thoughts Daniel?

review: Approve
Revision history for this message
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
=== modified file 'plugins/grid/src/grid.cpp'
--- plugins/grid/src/grid.cpp 2012-10-18 11:05:40 +0000
+++ plugins/grid/src/grid.cpp 2012-10-24 15:45:52 +0000
@@ -695,6 +695,23 @@
695 if (event->type != MotionNotify || !mGrabWindow)695 if (event->type != MotionNotify || !mGrabWindow)
696 return;696 return;
697697
698 /* Detect when cursor enters another output */
699
700 currentWorkarea = screen->getWorkareaForOutput
701 (screen->outputDeviceForPoint (pointerX, pointerY));
702 if (lastWorkarea != currentWorkarea)
703 {
704 lastWorkarea = currentWorkarea;
705
706 if (cScreen)
707 cScreen->damageRegion (desiredSlot);
708
709 initiateCommon (0, 0, o, typeToMask (edgeToGridType ()), false, false);
710
711 if (cScreen)
712 cScreen->damageRegion (desiredSlot);
713 }
714
698 out = screen->outputDevs ().at (715 out = screen->outputDevs ().at (
699 screen->outputDeviceForPoint (CompPoint (pointerX, pointerY)));716 screen->outputDeviceForPoint (CompPoint (pointerX, pointerY)));
700717
@@ -731,23 +748,6 @@
731 else748 else
732 edge = NoEdge;749 edge = NoEdge;
733750
734 /* Detect when cursor enters another output */
735
736 currentWorkarea = screen->getWorkareaForOutput
737 (screen->outputDeviceForPoint (pointerX, pointerY));
738 if (lastWorkarea != currentWorkarea)
739 {
740 lastWorkarea = currentWorkarea;
741
742 if (cScreen)
743 cScreen->damageRegion (desiredSlot);
744
745 initiateCommon (0, 0, o, typeToMask (edgeToGridType ()), false, false);
746
747 if (cScreen)
748 cScreen->damageRegion (desiredSlot);
749 }
750
751 /* Detect edge region change */751 /* Detect edge region change */
752752
753 if (lastEdge != edge)753 if (lastEdge != edge)

Subscribers

People subscribed via source and target branches