Merge lp:~compiz-team/compiz/compiz.fix_1037164 into lp:compiz/0.9.9

Proposed by Sam Spilsbury
Status: Merged
Approved by: Daniel van Vugt
Approved revision: 3536
Merged at revision: 3542
Proposed branch: lp:~compiz-team/compiz/compiz.fix_1037164
Merge into: lp:compiz/0.9.9
Diff against target: 25 lines (+6/-2)
1 file modified
plugins/wall/src/wall.cpp (+6/-2)
To merge this branch: bzr merge lp:~compiz-team/compiz/compiz.fix_1037164
Reviewer Review Type Date Requested Status
Daniel van Vugt Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+141779@code.launchpad.net

Commit message

Fixed: Clicking on semi-maximized windows in a different workspace fails to
switch to the correct workspace. (LP: #1037164)

Description of the change

Handle negative values returned by viewportForGeometry correclty.

Previously if we got a negative value for viewportForGeometry, we'd try and
move to -n, -m, which would fail because checkDestination disallows those values.

checkDestination updated to accept negative values, because by default, we
actually pass negative values to it (since -dx, and -dy are negated before entry
into moveViewport). In any case, positive values are preferred, and the caller
was updated to provide positive values in case viewportForGeometry returns
negative values in order to avoid any unexpected behaviour.

In addition, if the window position needed to be changed, we'd be moving
the window by viewport-distance and not window distance due to a typo. That
was also fixed.

(LP: #1037164)

Not sure about the best way to autotest this. The only way I can think of would involve significant refactoring of calling code, which is no good.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Verified the bug seems to be fixed (using plain compiz and the switcher (Ctrl+)Alt+Tab).

However this change causes a regression: I can now wrap backwards from left-most to right-most workspaces using Ctrl+Alt+Left even though allow_wraparound is turned off.

review: Needs Fixing
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Thanks, I'll have a look into it.

On Fri, Jan 4, 2013 at 3:44 PM, Daniel van Vugt
<email address hidden> wrote:
> Review: Needs Fixing
>
> Verified the bug seems to be fixed (using plain compiz and the switcher (Ctrl+)Alt+Tab).
>
> However this change causes a regression: I can now wrap backwards from left-most to right-most workspaces using Ctrl+Alt+Left even though allow_wraparound is turned off.
> --
> https://code.launchpad.net/~compiz-team/compiz/compiz.fix_1037164/+merge/141779
> Your team Compiz Maintainers is subscribed to branch lp:compiz.

--
Sam Spilsbury

3536. By Sam Spilsbury

Revert the handling of negative co-ords.

While the old behaviour is still bad, changing it has unintended side effects

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Fixed

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Verified bug fixed. No regression any more.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/wall/src/wall.cpp'
2--- plugins/wall/src/wall.cpp 2012-12-04 16:08:27 +0000
3+++ plugins/wall/src/wall.cpp 2013-01-04 08:46:22 +0000
4@@ -608,6 +608,10 @@
5 dx = viewport.x ();
6 dy = viewport.y ();
7
8+ /* Handle negative value */
9+ dx = (unsigned int) dx % screen->vpSize ().width ();
10+ dy = (unsigned int) dy % screen->vpSize ().height ();
11+
12 dx -= screen->vp ().x ();
13 dy -= screen->vp ().y ();
14
15@@ -637,8 +641,8 @@
16 mask |= d.x () !=0 ? CWX : 0;
17 mask |= d.y () !=0 ? CWY : 0;
18
19- xwc.x = window->serverGeometry ().x () + dx;
20- xwc.y = window->serverGeometry ().y () + dy;
21+ xwc.x = window->serverGeometry ().x () + d.x ();
22+ xwc.y = window->serverGeometry ().y () + d.y ();
23
24 window->configureXWindow (mask, &xwc);
25 }

Subscribers

People subscribed via source and target branches