Merge lp:~compiz-team/compiz-wall-plugin/compiz-wall-plugin.fix_762335 into lp:compiz-wall-plugin

Proposed by Sam Spilsbury
Status: Merged
Merged at revision: 129
Proposed branch: lp:~compiz-team/compiz-wall-plugin/compiz-wall-plugin.fix_762335
Merge into: lp:compiz-wall-plugin
Diff against target: 68 lines (+49/-2)
1 file modified
src/wall.cpp (+49/-2)
To merge this branch: bzr merge lp:~compiz-team/compiz-wall-plugin/compiz-wall-plugin.fix_762335
Reviewer Review Type Date Requested Status
Jason Smith (community) Approve
Review via email: mp+78964@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Jason Smith (jassmith) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/wall.cpp'
--- src/wall.cpp 2011-03-14 16:07:54 +0000
+++ src/wall.cpp 2011-10-11 13:45:27 +0000
@@ -608,7 +608,7 @@
608 int dx, dy;608 int dx, dy;
609 CompPoint viewport;609 CompPoint viewport;
610610
611 viewport = window->defaultViewport ();611 screen->viewportForGeometry (window->geometry (), viewport);
612 dx = viewport.x ();612 dx = viewport.x ();
613 dy = viewport.y ();613 dy = viewport.y ();
614614
@@ -617,8 +617,55 @@
617617
618 if (dx || dy)618 if (dx || dy)
619 {619 {
620 ws->moveViewport (-dx, -dy, None);620 XWindowChanges xwc;
621 unsigned int mask = 0;
622
623 ws->moveViewport (-dx, -dy, false);
621 ws->focusDefault = false;624 ws->focusDefault = false;
625
626 CompWindow::Geometry sbr (window->serverBorderRect ().x (),
627 window->serverBorderRect ().y (),
628 window->serverBorderRect ().width (),
629 window->serverBorderRect ().height (),
630 0);
631 CompRegion sbrRegion (sbr);
632 int output = screen->outputDeviceForGeometry (sbr);
633 CompRegion outputRegion (screen->outputDevs ()[output].workArea ());
634
635 /* If the window would be partially offscreen
636 * after it was moved then we should move it back
637 * so that it is completely onscreen, since we moved
638 * from mostly offscreen on B to mostly onscreen on A,
639 * the user should be able to see their selected window */
640 CompRegion inter = sbrRegion.intersected (outputRegion);
641 CompRegion rem = sbrRegion - outputRegion;
642
643 foreach (const CompRect &r, rem.rects ())
644 {
645 if (r.x1 () >= inter.boundingRect ().x2 ())
646 {
647 xwc.x = window->serverGeometry ().x () - r.width ();
648 mask |= CWX;
649 }
650 else if (r.x2 () <= inter.boundingRect ().x1 ())
651 {
652 xwc.x = window->serverGeometry ().x () + r.width ();
653 mask |= CWX;
654 }
655
656 if (r.y1 () >= inter.boundingRect ().y2 ())
657 {
658 xwc.y = window->serverGeometry ().y () - r.height ();
659 mask |= CWY;
660 }
661 else if (r.y2 () <= inter.boundingRect ().y1 ())
662 {
663 xwc.y = window->serverGeometry ().y () + r.height ();
664 mask |= CWY;
665 }
666 }
667
668 window->configureXWindow (mask, &xwc);
622 }669 }
623 }670 }
624671

Subscribers

People subscribed via source and target branches

to all changes: