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

Proposed by Sam Spilsbury
Status: Superseded
Proposed branch: lp:~aacid/compiz/do_not_change_viewport_on_resize
Merge into: lp:compiz/0.9.9
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
jenkins (community) continuous-integration Needs Fixing
Compiz Maintainers Pending
Daniel van Vugt Pending
Review via email: mp+126878@code.launchpad.net

This proposal supersedes a proposal from 2012-09-10.

This proposal has been superseded by a proposal from 2012-10-11.

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 : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Sam Spilsbury (smspillaz) wrote : Posted in a previous version of this proposal

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 : Posted in a previous version of this proposal

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 : Posted in a previous version of this proposal

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 : Posted in a previous version of this proposal

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 : Posted in a previous version of this proposal

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 : Posted in a previous version of this proposal

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

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

The branches have changed. Please resubmit targeting lp:compiz

review: Needs Resubmitting
Revision history for this message
jenkins (martin-mrazik+qa) wrote :
review: Needs Fixing (continuous-integration)
3363. By Albert Astals Cid

Merge lp:compiz

Revision history for this message
jenkins (martin-mrazik+qa) wrote :
review: Needs Fixing (continuous-integration)

Unmerged revisions

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-09-18 15:51:59 +0000
+++ src/window.cpp 2012-10-10 11:48:23 +0000
@@ -3495,15 +3495,9 @@
3495{3495{
3496 CompRect workArea;3496 CompRect workArea;
3497 int mask = 0;3497 int mask = 0;
3498 int x, y;
3499 CompOutput *output;3498 CompOutput *output;
3500 CompPoint viewport;3499 CompPoint viewport;
35013500
3502 screen->viewportForGeometry (old, viewport);
3503
3504 x = (viewport.x () - screen->vp ().x ()) * screen->width ();
3505 y = (viewport.y () - screen->vp ().y ()) * screen->height ();
3506
3507 /* Try to select and output device that the window is on first3501 /* Try to select and output device that the window is on first
3508 * and make sure if we are fullscreening or maximizing that the3502 * and make sure if we are fullscreening or maximizing that the
3509 * window is actually able to fit on this output ... otherwise3503 * window is actually able to fit on this output ... otherwise
@@ -3585,15 +3579,15 @@
35853579
3586 if (fullscreenMonitorsSet)3580 if (fullscreenMonitorsSet)
3587 {3581 {
3588 xwc->x = x + fullscreenMonitorRect.x ();3582 xwc->x = fullscreenMonitorRect.x ();
3589 xwc->y = y + fullscreenMonitorRect.y ();3583 xwc->y = fullscreenMonitorRect.y ();
3590 xwc->width = fullscreenMonitorRect.width ();3584 xwc->width = fullscreenMonitorRect.width ();
3591 xwc->height = fullscreenMonitorRect.height ();3585 xwc->height = fullscreenMonitorRect.height ();
3592 }3586 }
3593 else3587 else
3594 {3588 {
3595 xwc->x = x + output->x ();3589 xwc->x = output->x ();
3596 xwc->y = y + output->y ();3590 xwc->y = output->y ();
3597 xwc->width = output->width ();3591 xwc->width = output->width ();
3598 xwc->height = output->height ();3592 xwc->height = output->height ();
3599 }3593 }
@@ -3695,7 +3689,7 @@
3695 * by the gravity value (so that the corner that the gravity specifies3689 * by the gravity value (so that the corner that the gravity specifies
3696 * is 'anchored' to that edge of the workarea) */3690 * is 'anchored' to that edge of the workarea) */
36973691
3698 xwc->y = y + workArea.y () + border.top;3692 xwc->y = workArea.y () + border.top;
3699 mask |= CWY;3693 mask |= CWY;
37003694
3701 switch (priv->sizeHints.win_gravity)3695 switch (priv->sizeHints.win_gravity)
@@ -3706,7 +3700,7 @@
3706 /* Shift the window so that the bottom meets the top of the bottom */3700 /* Shift the window so that the bottom meets the top of the bottom */
3707 height = xwc->height + old.border () * 2;3701 height = xwc->height + old.border () * 2;
37083702
3709 max = y + workArea.bottom ();3703 max = workArea.bottom ();
3710 if (xwc->y + xwc->height + border.bottom > max)3704 if (xwc->y + xwc->height + border.bottom > max)
3711 {3705 {
3712 xwc->y = max - height - border.bottom;3706 xwc->y = max - height - border.bottom;
@@ -3732,7 +3726,7 @@
37323726
3733 if (state & CompWindowStateMaximizedHorzMask)3727 if (state & CompWindowStateMaximizedHorzMask)
3734 {3728 {
3735 xwc->x = x + workArea.x () + border.left;3729 xwc->x = workArea.x () + border.left;
3736 mask |= CWX;3730 mask |= CWX;
37373731
3738 switch (priv->sizeHints.win_gravity)3732 switch (priv->sizeHints.win_gravity)
@@ -3742,7 +3736,7 @@
3742 case EastGravity:3736 case EastGravity:
3743 width = xwc->width + old.border () * 2;3737 width = xwc->width + old.border () * 2;
37443738
3745 max = x + workArea.right ();3739 max = workArea.right ();
37463740
3747 if (old.x () + (int) old.width () + border.right > max)3741 if (old.x () + (int) old.width () + border.right > max)
3748 {3742 {
@@ -3751,7 +3745,7 @@
3751 }3745 }
3752 else if (old.x () + width + border.right > max)3746 else if (old.x () + width + border.right > max)
3753 {3747 {
3754 xwc->x = x + workArea.x () +3748 xwc->x = workArea.x () +
3755 (workArea.width () - border.left - width -3749 (workArea.width () - border.left - width -
3756 border.right) / 2 + border.left;3750 border.right) / 2 + border.left;
3757 mask |= CWX;3751 mask |= CWX;

Subscribers

People subscribed via source and target branches