Merge lp:~townsend/compiz/fix-auto-vp-switch-0.9.10 into lp:compiz/0.9.10

Proposed by Christopher Townsend
Status: Merged
Approved by: Brandon Schaefer
Approved revision: 3791
Merged at revision: 3791
Proposed branch: lp:~townsend/compiz/fix-auto-vp-switch-0.9.10
Merge into: lp:compiz/0.9.10
Diff against target: 55 lines (+21/-18)
1 file modified
plugins/wall/src/wall.cpp (+21/-18)
To merge this branch: bzr merge lp:~townsend/compiz/fix-auto-vp-switch-0.9.10
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Brandon Schaefer (community) Approve
Review via email: mp+186881@code.launchpad.net

Commit message

Fix regression when selecting apps on a different viewport than the current one will no longer automatically switch the viewport.

Description of the change

= Issue =
A regression has occurred in which auto switching viewports no longer happens when using global Alt-Tab or selecting an app on the Launcher that is in a different viewport.

= Fix =
Be more smart about when to check for the optionGetAutoSwitchVpAndWindow () bool. Now only check in the code block that actually moves the window to a different viewport. This is only a half fix now for bug #1092323. The part of that bug to not switch viewports when the window is > 50% in a different viewport is still not fixed.

To post a comment you must log in.
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Confirmed fixes the issue, though we'll have to re-visit the other bug this was fixing :). This is a bigger thing to get fixed first.

LGTM

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

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 2013-08-28 12:06:03 +0000
3+++ plugins/wall/src/wall.cpp 2013-09-20 20:47:17 +0000
4@@ -553,7 +553,7 @@
5 {
6 WALL_SCREEN (screen);
7
8- if (ws->optionGetAutoSwitchVpAndWindow () && window->placed () && !screen->otherGrabExist ("wall", "switcher", 0))
9+ if (window->placed () && !screen->otherGrabExist ("wall", "switcher", 0))
10 {
11 int dx, dy;
12 CompPoint viewport;
13@@ -582,23 +582,26 @@
14 return;
15 }
16
17- ws->focusDefault = false;
18-
19- CompRegion screenRegion;
20-
21- foreach (const CompOutput &o, screen->outputDevs ())
22- screenRegion += o.workArea ();
23-
24- CompPoint d = compiz::wall::movementWindowOnScreen (window->serverBorderRect (),
25- screenRegion);
26-
27- mask |= d.x () !=0 ? CWX : 0;
28- mask |= d.y () !=0 ? CWY : 0;
29-
30- xwc.x = window->serverGeometry ().x () + d.x ();
31- xwc.y = window->serverGeometry ().y () + d.y ();
32-
33- window->configureXWindow (mask, &xwc);
34+ if (ws->optionGetAutoSwitchVpAndWindow ())
35+ {
36+ ws->focusDefault = false;
37+
38+ CompRegion screenRegion;
39+
40+ foreach (const CompOutput &o, screen->outputDevs ())
41+ screenRegion += o.workArea ();
42+
43+ CompPoint d = compiz::wall::movementWindowOnScreen (window->serverBorderRect (),
44+ screenRegion);
45+
46+ mask |= d.x () !=0 ? CWX : 0;
47+ mask |= d.y () !=0 ? CWY : 0;
48+
49+ xwc.x = window->serverGeometry ().x () + d.x ();
50+ xwc.y = window->serverGeometry ().y () + d.y ();
51+
52+ window->configureXWindow (mask, &xwc);
53+ }
54 }
55 }
56

Subscribers

People subscribed via source and target branches