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

Scott Moreau oreaus at gmail.com
Thu Nov 15 12:38:54 PST 2012


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.


>
>
>>
>>
>> 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">
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20121115/1d2f2877/attachment.html>


More information about the wayland-devel mailing list