[PATCH v5 xdg-shell-unstable-v6] xdg-shell: Add min/max size requests
Jasper St. Pierre
jstpierre at mecheye.net
Mon Apr 11 19:10:44 UTC 2016
I figured min/max would be double-buffered state and require a commit
to take affect. In fact, anything else means that we can't extend with
additional size constraints in the future, since they couldn't be
applied atomically.
On Mon, Apr 11, 2016 at 12:02 PM, Bill Spitzak <spitzak at gmail.com> wrote:
> Because of the two requests, the compositor can at least momentarily be in a
> state where max < min (otherwise it is impossible for a client to change the
> size range to a new one that does not intersect the old one). May want to
> specify what happens in this case. In particular it is required that setting
> the max does not change the min and vice-versa. And if max<min does it act
> as though both values are equal to max, min, (max+min)/2, or what (my
> recommendation is to use min).
>
> Then again the above may be considered obvious and I am worried about
> nothing, in which case the current documentation is just fine.
>
>
> On Mon, Apr 11, 2016 at 5:23 AM, Yong Bakos <junk at humanoriented.com> wrote:
>>
>> On Apr 11, 2016, at 2:59 AM, Olivier Fourdan <ofourdan at redhat.com> wrote:
>> >
>> > Some application may wish to restrict their window in size, but
>> > xdg-shell has no mechanism for the client to specify a maximum or
>> > minimum size.
>> >
>> > As a result, the compositor may try to maximize or fullscreen a window
>> > while the client would not allow for the requested size.
>> >
>> > Add new requests "set_max_size" and "set_min_size" to xdg-shell so that
>> > the client can tell the compositor what would be its smallest/largest
>> > acceptable size, and that the compositor can decide if maximize or
>> > fullscreen is achievable, draw an accurate animation, etc.
>> >
>> > Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
>> > Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=764413
>>
>> Looks good to me. (Note: I'm a novice reviewer.)
>>
>> Reviewed-by: Yong Bakos <ybakos at humanoriented.com>
>>
>> yong
>>
>>
>> > ---
>> > v2: Rename the request to "set_preferred_max_size",
>> > add "set_preferred_min_size" as well
>> > v3: Rebase above patch 72427 in branch xdg-shell-unstable-v6
>> > Rephrase description to clarify the unscaled size and using 0 to
>> > reset back the preferred size to an unspecified state
>> > v4: Patch the correct xml file (v6, not v5 <facepalm>)
>> > Fix multiple mismatch of min/max in the description
>> > Remove mention of "unscaled", specify window geometry coordinates
>> > and refer to set_window_geometry.
>> > v5: Fix typos and remove "preferred" from the name and description as
>> > requested by several people on the ML and irc.
>> >
>> > unstable/xdg-shell/xdg-shell-unstable-v6.xml | 60
>> > ++++++++++++++++++++++++++++
>> > 1 file changed, 60 insertions(+)
>> >
>> > diff --git a/unstable/xdg-shell/xdg-shell-unstable-v6.xml
>> > b/unstable/xdg-shell/xdg-shell-unstable-v6.xml
>> > index 3fc7d42..8ab84f5 100644
>> > --- a/unstable/xdg-shell/xdg-shell-unstable-v6.xml
>> > +++ b/unstable/xdg-shell/xdg-shell-unstable-v6.xml
>> > @@ -489,6 +489,66 @@
>> > <arg name="states" type="array"/>
>> > </event>
>> >
>> > + <request name="set_max_size">
>> > + <description summary="set the maximum size">
>> > + Set a maximum size for the window.
>> > +
>> > + The client can specify a maximum size so that the compositor does
>> > + not try to configure the window beyond this size.
>> > +
>> > + The width and height arguments are in window geometry coordinates.
>> > + See set_window_geometry.
>> > +
>> > + The compositor can use this information to allow or disallow
>> > + different states like maximize or fullscreen and draw accurate
>> > + animations.
>> > +
>> > + Similarly, a tiling window manager may use this information to
>> > + place and resize client windows in a more effective way.
>> > +
>> > + If never set, the maximum size of the window is not limited by
>> > + the client.
>> > +
>> > + A value of zero in the request for either width, height or both
>> > + means that the client has no expected maximum size in the given
>> > + dimension. As a result, a client wishing to reset the maximum size
>> > + to an unspecified state can use zero for width and height in the
>> > + request.
>> > + </description>
>> > + <arg name="width" type="int"/>
>> > + <arg name="height" type="int"/>
>> > + </request>
>> > +
>> > + <request name="set_min_size">
>> > + <description summary="set the minimum size">
>> > + Set a minimum size for the window.
>> > +
>> > + The client can specify a minimum size so that the compositor does
>> > + not try to configure the window below this size.
>> > +
>> > + The width and height arguments are in window geometry coordinates.
>> > + See set_window_geometry.
>> > +
>> > + The compositor can use this information to allow or disallow
>> > + different states like maximize or fullscreen and draw accurate
>> > + animations.
>> > +
>> > + Similarly, a tiling window manager may use this information to
>> > + place and resize client windows in a more effective way.
>> > +
>> > + If never set, the minimum size of the window is not limited by
>> > + the client.
>> > +
>> > + A value of zero in the request for either width, height or both
>> > + means that the client has no expected minimum size in the given
>> > + dimension. As a result, a client wishing to reset the minimum size
>> > + to an unspecified state can use zero for width and height in the
>> > + request.
>> > + </description>
>> > + <arg name="width" type="int"/>
>> > + <arg name="height" type="int"/>
>> > + </request>
>> > +
>> > <request name="set_maximized">
>> > <description summary="maximize the window">
>> > Maximize the surface.
>> > --
>> > 2.5.5
>> >
>>
>
--
Jasper
More information about the wayland-devel
mailing list