[compiz] Patch to wobbly snap for outputs

David Reveman davidr at novell.com
Mon Dec 18 13:42:31 PST 2006


On Mon, 2006-12-18 at 13:31 -0700, Mike Cook wrote:
> On Mon, Dec 18, 2006 at 11:46 AM, David Reveman wrote: 
> >> 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?
> 
> As I understand the spec, and verified in testing, the design is for
> the _NET_WM_STRUT_PARTIAL hint (and the fallback _NET_WM_STRUT) to
> define each strut as only a distance from the screen edge, and the
> start/end (added in _PARTIAL) specifies how much of that edge it takes
> (instead of defaulting to the entire screen height or width).  The
> starting edge is always an edge of the screen.

Yes, you're right. leftX1 will always be 0 and leftX2 will always be
screenW but the code in computeWorkareForBox doesn't assume so and it
shouldn't. leftX1 always being 0 or not doesn't matter, what I mentioned
above should still be valid and the
"if (y1 < pBox- >y2 && y2 > pBox- >y1 && x2 < pBox- >x2)"
check should be all we need to get the left edge correct.

> 
> So, for your example above, I don't think struts get set for a floating
> window, but you could have two with one being on the right edge of the
> left screen, and the other being on the left edge of the right screen.
> In that case the strut edges for the right edge panel are computed in
> Compiz to be something like:
> 
> leftX1 = 0;
> leftX2 = screenW / 2 + panelW;
> 
> +------ ---- +---------- +
> |__________|_         |
> |          | |        |
> |__________|_|        |
> |          |          |
> +-------- -- +- --------- +
> 
> And for the left panel it would be:
> 
> rightX1 = screenW / 2 - panelW;
> rightX2 = screenW;
> 
> +--- ------- +- --------- +
> |         _|__________|
> |        | |          |
> |        |_|__________|
> |          |          |
> +--- ------- +--- ------- +
> 
> Here's a reference to the spec, so someone can check my understanding:
> http://standards.freedesktop.org/wm-spec/1.3/ar01s05.html#id2523368 



-David



More information about the compiz mailing list