Merge lp:~sjakthol/compiz/fix-839602 into lp:compiz/0.9.9

Proposed by Sami Jaktholm
Status: Merged
Approved by: Daniel van Vugt
Approved revision: 3418
Merged at revision: 3433
Proposed branch: lp:~sjakthol/compiz/fix-839602
Merge into: lp:compiz/0.9.9
Diff against target: 23 lines (+4/-3)
1 file modified
plugins/grid/src/grid.cpp (+4/-3)
To merge this branch: bzr merge lp:~sjakthol/compiz/fix-839602
Reviewer Review Type Date Requested Status
Daniel van Vugt Approve
Sam Spilsbury Approve
PS Jenkins bot continuous-integration Pending
Review via email: mp+129739@code.launchpad.net

Commit message

The grid resize hint overlay doesn't disappear when the window is
moved along the edge from a region that has a resize action set to a
region without one (LP: #839602).

When the edge changes, grid calculates the target rectangle for the
transformation. The previous overlay will be destroyed only if the
new target rectangle is different from the previous target rectangle.
But when the target is GridUnknown (the action for the region has set
to be None), initiateCommon bails out right away leaving the target
rectangle unchanged. And thus grid thinks nothing has changed and
the old overlay is left intact.

The fix resets the target rectangle to be at (0, 0) with height and
width of 0. As the previous rectangle is now different from the new
one, the old overlay will fade out. The same technique is used to
destroy the overlay when the window is moved away from the target region.

Description of the change

Test case:
1. Open CCSM
2. Go to Grid settings -> Edges -> Resize Actions
3. Set 'Right Edge' to 'Right Half' and 'Bottom Right Corner' to 'None'
4. Drag a nautilus window to the Right edge (don't drop the window yet)
5. Keep dragging the window along the edge to the Bottom Right Corner
6. Drop the window.

Current behavior:
At (4) the orange overlay covers the right part of the screen, at (5) the overlay is still there (incorrect behavior, if you drop the window here, nothing happens) and at (6) the overlay doesn't disappear.

Behavior with this fix:
At (4) the orange overlay covers the right part of the screen, at (5) the overlay disappears (correct as nothing will happen if you drop the window here) and at (6) nothing interesting happens.

To post a comment you must log in.
Revision history for this message
Sam Spilsbury (smspillaz) :
review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Works for me.

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-09-24 11:31:11 +0000
3+++ plugins/grid/src/grid.cpp 2012-10-15 19:21:22 +0000
4@@ -753,15 +753,16 @@
5 if (lastEdge != edge)
6 {
7 bool check = false;
8+ unsigned int target = typeToMask (edgeToGridType ());
9 lastSlot = desiredSlot;
10
11- if (edge == NoEdge)
12- desiredSlot.setGeometry (0, 0, 0, 0);
13+ if (edge == NoEdge || target == GridUnknown)
14+ desiredSlot.setGeometry (0, 0, 0, 0);
15
16 if (cScreen)
17 cScreen->damageRegion (desiredSlot);
18
19- check = initiateCommon (NULL, 0, o, typeToMask (edgeToGridType ()), false, false);
20+ check = initiateCommon (NULL, 0, o, target, false, false);
21
22 if (cScreen)
23 cScreen->damageRegion (desiredSlot);

Subscribers

People subscribed via source and target branches