[PATCH wayland 1/2 v2] protocol: Add resize from center flag.

Kristian Høgsberg hoegsberg at gmail.com
Fri Nov 16 16:32:07 PST 2012


On Thu, Nov 15, 2012 at 01:38:54PM -0700, Scott Moreau wrote:
> On Thu, Nov 15, 2012 at 1:02 PM, Scott Moreau <oreaus at gmail.com> wrote:
> 
> >
> >
> > On Thu, Nov 15, 2012 at 12:57 PM, Bill Spitzak <spitzak at gmail.com> wrote:
> >
> >> A scheme I have seen is to use 15 (ie all 4 edge flags or'd) for
> >> center-resize. This makes it possible to add 6 (left | right) for "center
> >> resize horizontally" and 3 (top | bottom) for "center resize vertically".
> >>
> >> The only values from 1-15 that have no meaning are when 3 edges are
> >> selected.
> >
> >
> > Now that you mention it, I believe I have seen this used somewhere too and
> > it makes sense. As a side note, the algorithm is always the same for
> > resize-from-center regardless if it's horizontal, vertical or both.
> >
> 
> I was tinkering with this idea and I remember trying it and why it wont fit
> nicely here. We're using resize_from_center as a separate single bit flag
> because it's actually resize state. Trying to make it have the meaning you
> described while maintaining this real-time behavior would require much more
> invasive changes. The edge flags would have to be stored separately because
> we have to remember what edges were set before toggling resize-from-center.
> It's simpler all around to have a single separate flag than try to mix
> everything together and try to decipher how to handle it later.

Hm, I like the idea of making left|right mean resize horizontally from
center, and trigger that on shift click side of window, and simiarly
for vertical resize from center on shift click top or bottom edge.
Shift click any corner is resize from center for all sides.

We can just add 'left_right', 'top_bttom' and 'all' enums that are the
bitwise or of left and right etc, and all being 15.  Why would that
not work?  Seem like a pretty elegant approach.

Kristian

> >
> >
> >>
> >>
> >> Scott Moreau wrote:
> >>
> >>> ---
> >>>
> >>> v2:
> >>>
> >>> No changes.
> >>>
> >>>  protocol/wayland.xml | 1 +
> >>>  1 file changed, 1 insertion(+)
> >>>
> >>> diff --git a/protocol/wayland.xml b/protocol/wayland.xml
> >>> index 4205dae..25fc3ae 100644
> >>> --- a/protocol/wayland.xml
> >>> +++ b/protocol/wayland.xml
> >>> @@ -551,6 +551,7 @@
> >>>        <entry name="right" value="8"/>
> >>>        <entry name="top_right" value="9"/>
> >>>        <entry name="bottom_right" value="10"/>
> >>> +      <entry name="from_center" value="16"/>
> >>>      </enum>
> >>>       <request name="resize">
> >>>
> >>
> >

> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel



More information about the wayland-devel mailing list