[PATCH v2] xdg-shell: add preferred min/max size requests

Jasper St. Pierre jstpierre at mecheye.net
Wed Apr 6 16:38:13 UTC 2016


On Tue, Apr 5, 2016 at 2:36 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 advertise such a maximum
> or minimum size the compositor can use.
>
> 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_preferred_max_size" and "set_preferred_min_size"
> to xdg-shell so that the client can tell the compositor which would be
> its preferred smallest/largest acceptable size, so that he compositor
> can decide if maximize or fullscreen makes sense, draw an accurate
> animation, etc.
>
> Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
> Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=764413
> ---
>  v2: Rename the request to "set_preferred_max_size",
>      add "set_preferred_min_size" as well
>
>  unstable/xdg-shell/xdg-shell-unstable-v5.xml | 46 ++++++++++++++++++++++++++++
>  1 file changed, 46 insertions(+)
>
> diff --git a/unstable/xdg-shell/xdg-shell-unstable-v5.xml b/unstable/xdg-shell/xdg-shell-unstable-v5.xml
> index 542491f..9c9b4d2 100644
> --- a/unstable/xdg-shell/xdg-shell-unstable-v5.xml
> +++ b/unstable/xdg-shell/xdg-shell-unstable-v5.xml
> @@ -462,6 +462,52 @@
>        <arg name="height" type="int"/>
>      </request>
>
> +    <request name="set_preferred_max_size">
> +      <description summary="set the preferred maximum size">
> +        Set a preferred maximum size for the surface.
> +
> +        The client can specify a maximum width and/or height to tell the
> +        compositor what would be the preferred largest size for a surface.
> +
> +        The compositor may use this information from the client to allow
> +        or disallow different states like maximixe or fullscreen and
> +        draw accurate animations.
> +        Similarily, a tiling window manager can use this information to
> +        place and resize client windows in a more effective layout.
> +
> +        If never set, the size of the surface is not limited by the client.
> +
> +        A value of zero for either width, height or both means that the
> +        client has no preference regarding the maximum size in the given
> +        dimension.

Is "zero" the same as "never set"? If so, I would rephrase this so
that it's clearer about that. If not, we need a way of resetting back
to the unspecified state.

> +      </description>
> +      <arg name="width" type="int"/>
> +      <arg name="height" type="int"/>
> +    </request>
> +
> +    <request name="set_preferred_min_size">
> +      <description summary="set the preferred minimum size">
> +        Set a preferred minimum size for the surface.
> +
> +        The client can specify a minimum width and/or height to tell the
> +        compositor what would be the preferable smallest size of a surface.
> +
> +        The compositor may use this information from the client to allow
> +        or disallow different states like maximixe or fullscreen and
> +        draw accurate animations.
> +        Similarily, a tiling window manager can use this information to
> +        place and resize client windows in a more effective layout.
> +
> +        If never set, the size of the surface is not limited by the client.
> +
> +        A value of zero for either width, height or both means that the
> +        client has no preference regarding the minimum size in the given
> +        dimension.
> +      </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
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel



-- 
  Jasper


More information about the wayland-devel mailing list