[compiz] Patch to wobbly snap for outputs
David Reveman
davidr at novell.com
Mon Dec 18 10:46:39 PST 2006
On Mon, 2006-12-18 at 11:03 -0700, Mike Cook wrote:
> On Mon, Dec 18, 2006 at 9:50 AM, David Reveman wrote:
> > - if (y1 < pBox- >y2 && y2 > pBox- >y1)
> > + /* consider strut if start/end overlaps box, size ends in box,
> > + and edge is outside box or both edge & size in same output
> > + (in order to handle struts across multiple outputs) */
> > + if (y1 < pBox- >y2 && y2 > pBox- >y1 && x2 < pBox- >x2 &&
> > + (x1 < pBox- >x1 ||
> > + outputDeviceForPoint(w- >screen, x1, y1) ==
> > + outputDeviceForPoint(w- >screen, x2- 1, y2- 1)))
> >
> > The "x2 < pBox- >x2" check makes a lost of sense. However I fail to see
> > why this:
> >
> > + (x1 < pBox- >x1 ||
> > + outputDeviceForPoint(w- >screen, x1, y1) ==
> > + outputDeviceForPoint(w- >screen, x2- 1, y2- 1))
> >
> > check is necessary. We already know that "x2 < pBox- >x2" so the only
> > struts that are rejected from this check is those that are partially
> > outside the box vertically and why we would want to reject those?
>
> Since we know the strut ends within the box, that secondary check is
> meant to handle the two basic cases of a smaller box (such as for an
> output workarea) to allow a strut which starts outside it, and for a larger
> box (such as for the screen workarea) to ignore any internal struts which
> cross over multiple outputs.
Sorry, I still don't get it. What struts are a vertical kicker panel
setting?
+-----------------+-----------------+
| _|_ |
| | | | |
| | | | |
| |_|_| |
| | |
+-----------------+-----------------+
If the screen looks like this and the thing in the middle is a panel
covering both outputs I assume that the struts are set to either
leftX1 = screenW / 2 - panelW / 2;
leftX2 = screenW / 2 + panelW / 2;
or
rightX1 = screenW / 2 - panelW / 2;
rightX2 = screenW / 2 + panelW / 2;
or that both those set are set.
"if (y1 < pBox->y2 && y2 > pBox->y1 && x2 < pBox->x2)"
should set the left edge properly for both outputs in all those cases.
What am I missing?
-David
More information about the compiz
mailing list