Merge lp:~aacid/compiz/do_not_change_viewport_on_resize into lp:compiz/0.9.8

Proposed by Albert Astals Cid
Status: Superseded
Proposed branch: lp:~aacid/compiz/do_not_change_viewport_on_resize
Merge into: lp:compiz/0.9.8
Diff against target: 84 lines (+9/-15)
1 file modified
src/window.cpp (+9/-15)
To merge this branch: bzr merge lp:~aacid/compiz/do_not_change_viewport_on_resize
Reviewer Review Type Date Requested Status
Daniel van Vugt Needs Resubmitting
jenkins (community) continuous-integration Approve
Compiz Maintainers Pending
Review via email: mp+123564@code.launchpad.net

This proposal has been superseded by a proposal from 2012-09-28.

Commit message

Do not move windows between viewports/workspaces when changing its size (e.g. maximizing)

Description of the change

Do not move windows between viewports/workspaces when changing its size (e.g. maximizing)

To be honest i'm a bit "scared" since this touches a function used by lots of other functions, but if we never want a window to change to a different viewports/workspaces i guess it makes sense.

To post a comment you must log in.
Revision history for this message
jenkins (martin-mrazik+qa) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Hmm, I think the intention of this code is to prevent windows that maximize themselves from going on to other viewports. I think it might make sense to add a check here to check if the window is on the currently active viewport, and if so, to always maximize it on that viewport.

Do you think you might be able to get this code under test?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Actually, I'm not sure about the validity of the bug itself. The bug seems to be that windows get maximized on the workspace which contains their centre-point. That's the way it was designed and the way it works. But that's not what's always intuitive to the user and hence the bug.

If that's the functionality we're aiming to change here then it looks like the wrong code is being modified.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I think you should look at this instead:

screen.cpp: compiz::private_screen::viewports::viewportForGeometry

review: Needs Fixing
Revision history for this message
Albert Astals Cid (aacid) wrote :

Daniel, right, the code is doign what you say (maximize on the workspace which contains their centre-point) which both I and Sam (that set the bug to Confirmed) think does not make sense.

I disagree the wrong code is being modified, what
   CompScreenImpl::viewportForGeometry (const CompWindow::Geometry& gm, CompPoint& viewport)
does is not return in viewport the viewport that gm should have but the "difference" in viewports from the current one, i.e. it can return {-1, -1} if it thinks the window shall be one viewport left and one top from its current one.

Of course I could make that function return always {0,0} (i.e. don't move me) but that might potentially break other plugins that use it like the group and the wall plugins

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

OK, I have no opinion until I can review this in detail later.

review: Abstain
Revision history for this message
Albert Astals Cid (aacid) wrote :

FWIW: I'm going on holiday tomorrow, will be back on 1st October

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The branches have changed. Please resubmit targeting lp:compiz

review: Needs Resubmitting
3363. By Albert Astals Cid

Merge lp:compiz

Unmerged revisions

3363. By Albert Astals Cid

Merge lp:compiz

3362. By Albert Astals Cid

Do not move windows between viewports/workspaces when changing its size (e.g. maximizing)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/window.cpp'
--- src/window.cpp 2012-08-30 01:08:48 +0000
+++ src/window.cpp 2012-09-10 14:43:28 +0000
@@ -3497,15 +3497,9 @@
3497{3497{
3498 CompRect workArea;3498 CompRect workArea;
3499 int mask = 0;3499 int mask = 0;
3500 int x, y;
3501 CompOutput *output;3500 CompOutput *output;
3502 CompPoint viewport;3501 CompPoint viewport;
35033502
3504 screen->viewportForGeometry (old, viewport);
3505
3506 x = (viewport.x () - screen->vp ().x ()) * screen->width ();
3507 y = (viewport.y () - screen->vp ().y ()) * screen->height ();
3508
3509 /* Try to select and output device that the window is on first3503 /* Try to select and output device that the window is on first
3510 * and make sure if we are fullscreening or maximizing that the3504 * and make sure if we are fullscreening or maximizing that the
3511 * window is actually able to fit on this output ... otherwise3505 * window is actually able to fit on this output ... otherwise
@@ -3587,15 +3581,15 @@
35873581
3588 if (fullscreenMonitorsSet)3582 if (fullscreenMonitorsSet)
3589 {3583 {
3590 xwc->x = x + fullscreenMonitorRect.x ();3584 xwc->x = fullscreenMonitorRect.x ();
3591 xwc->y = y + fullscreenMonitorRect.y ();3585 xwc->y = fullscreenMonitorRect.y ();
3592 xwc->width = fullscreenMonitorRect.width ();3586 xwc->width = fullscreenMonitorRect.width ();
3593 xwc->height = fullscreenMonitorRect.height ();3587 xwc->height = fullscreenMonitorRect.height ();
3594 }3588 }
3595 else3589 else
3596 {3590 {
3597 xwc->x = x + output->x ();3591 xwc->x = output->x ();
3598 xwc->y = y + output->y ();3592 xwc->y = output->y ();
3599 xwc->width = output->width ();3593 xwc->width = output->width ();
3600 xwc->height = output->height ();3594 xwc->height = output->height ();
3601 }3595 }
@@ -3697,7 +3691,7 @@
3697 * by the gravity value (so that the corner that the gravity specifies3691 * by the gravity value (so that the corner that the gravity specifies
3698 * is 'anchored' to that edge of the workarea) */3692 * is 'anchored' to that edge of the workarea) */
36993693
3700 xwc->y = y + workArea.y () + border.top;3694 xwc->y = workArea.y () + border.top;
3701 mask |= CWY;3695 mask |= CWY;
37023696
3703 switch (priv->sizeHints.win_gravity)3697 switch (priv->sizeHints.win_gravity)
@@ -3708,7 +3702,7 @@
3708 /* Shift the window so that the bottom meets the top of the bottom */3702 /* Shift the window so that the bottom meets the top of the bottom */
3709 height = xwc->height + old.border () * 2;3703 height = xwc->height + old.border () * 2;
37103704
3711 max = y + workArea.bottom ();3705 max = workArea.bottom ();
3712 if (xwc->y + xwc->height + border.bottom > max)3706 if (xwc->y + xwc->height + border.bottom > max)
3713 {3707 {
3714 xwc->y = max - height - border.bottom;3708 xwc->y = max - height - border.bottom;
@@ -3734,7 +3728,7 @@
37343728
3735 if (state & CompWindowStateMaximizedHorzMask)3729 if (state & CompWindowStateMaximizedHorzMask)
3736 {3730 {
3737 xwc->x = x + workArea.x () + border.left;3731 xwc->x = workArea.x () + border.left;
3738 mask |= CWX;3732 mask |= CWX;
37393733
3740 switch (priv->sizeHints.win_gravity)3734 switch (priv->sizeHints.win_gravity)
@@ -3744,7 +3738,7 @@
3744 case EastGravity:3738 case EastGravity:
3745 width = xwc->width + old.border () * 2;3739 width = xwc->width + old.border () * 2;
37463740
3747 max = x + workArea.right ();3741 max = workArea.right ();
37483742
3749 if (old.x () + (int) old.width () + border.right > max)3743 if (old.x () + (int) old.width () + border.right > max)
3750 {3744 {
@@ -3753,7 +3747,7 @@
3753 }3747 }
3754 else if (old.x () + width + border.right > max)3748 else if (old.x () + width + border.right > max)
3755 {3749 {
3756 xwc->x = x + workArea.x () +3750 xwc->x = workArea.x () +
3757 (workArea.width () - border.left - width -3751 (workArea.width () - border.left - width -
3758 border.right) / 2 + border.left;3752 border.right) / 2 + border.left;
3759 mask |= CWX;3753 mask |= CWX;

Subscribers

People subscribed via source and target branches