<div dir="ltr">I think this should probably use uint instead of int for params since zero is the "unset" number. Otherwise you have to write something about negative sizes.</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Apr 11, 2016 at 3:11 PM Jasper St. Pierre <<a href="mailto:jstpierre@mecheye.net">jstpierre@mecheye.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, Apr 11, 2016 at 12:59 AM, Olivier Fourdan <<a href="mailto:ofourdan@redhat.com" target="_blank">ofourdan@redhat.com</a>> wrote:<br>
> Some application may wish to restrict their window in size, but<br>
> xdg-shell has no mechanism for the client to specify a maximum or<br>
> minimum size.<br>
><br>
> As a result, the compositor may try to maximize or fullscreen a window<br>
> while the client would not allow for the requested size.<br>
><br>
> Add new requests "set_max_size" and "set_min_size" to xdg-shell so that<br>
> the client can tell the compositor what would be its smallest/largest<br>
> acceptable size, and that the compositor can decide if maximize or<br>
> fullscreen is achievable, draw an accurate animation, etc.<br>
><br>
> Signed-off-by: Olivier Fourdan <<a href="mailto:ofourdan@redhat.com" target="_blank">ofourdan@redhat.com</a>><br>
> Bugzilla: <a href="https://bugzilla.gnome.org/show_bug.cgi?id=764413" rel="noreferrer" target="_blank">https://bugzilla.gnome.org/show_bug.cgi?id=764413</a><br>
> ---<br>
> v2: Rename the request to "set_preferred_max_size",<br>
> add "set_preferred_min_size" as well<br>
> v3: Rebase above patch 72427 in branch xdg-shell-unstable-v6<br>
> Rephrase description to clarify the unscaled size and using 0 to<br>
> reset back the preferred size to an unspecified state<br>
> v4: Patch the correct xml file (v6, not v5 <facepalm>)<br>
> Fix multiple mismatch of min/max in the description<br>
> Remove mention of "unscaled", specify window geometry coordinates<br>
> and refer to set_window_geometry.<br>
> v5: Fix typos and remove "preferred" from the name and description as<br>
> requested by several people on the ML and irc.<br>
><br>
> unstable/xdg-shell/xdg-shell-unstable-v6.xml | 60 ++++++++++++++++++++++++++++<br>
> 1 file changed, 60 insertions(+)<br>
><br>
> diff --git a/unstable/xdg-shell/xdg-shell-unstable-v6.xml b/unstable/xdg-shell/xdg-shell-unstable-v6.xml<br>
> index 3fc7d42..8ab84f5 100644<br>
> --- a/unstable/xdg-shell/xdg-shell-unstable-v6.xml<br>
> +++ b/unstable/xdg-shell/xdg-shell-unstable-v6.xml<br>
> @@ -489,6 +489,66 @@<br>
> <arg name="states" type="array"/><br>
> </event><br>
><br>
> + <request name="set_max_size"><br>
> + <description summary="set the maximum size"><br>
> + Set a maximum size for the window.<br>
> +<br>
> + The client can specify a maximum size so that the compositor does<br>
> + not try to configure the window beyond this size.<br>
> +<br>
> + The width and height arguments are in window geometry coordinates.<br>
> + See set_window_geometry.<br>
> +<br>
> + The compositor can use this information to allow or disallow<br>
> + different states like maximize or fullscreen and draw accurate<br>
> + animations.<br>
> +<br>
> + Similarly, a tiling window manager may use this information to<br>
> + place and resize client windows in a more effective way.<br>
> +<br>
> + If never set, the maximum size of the window is not limited by<br>
> + the client.<br>
<br>
Delete this sentence, and merge it into the paragraph below.<br>
<br>
> + A value of zero in the request for either width, height or both<br>
> + means that the client has no expected maximum size in the given<br>
> + dimension. As a result, a client wishing to reset the maximum size<br>
> + to an unspecified state can use zero for width and height in the<br>
> + request.<br>
<br>
If never set, or a value of zero in the request, means that the client<br>
has no expected...<br>
<br>
> + </description><br>
> + <arg name="width" type="int"/><br>
> + <arg name="height" type="int"/><br>
> + </request><br>
> +<br>
> + <request name="set_min_size"><br>
> + <description summary="set the minimum size"><br>
> + Set a minimum size for the window.<br>
> +<br>
> + The client can specify a minimum size so that the compositor does<br>
> + not try to configure the window below this size.<br>
> +<br>
> + The width and height arguments are in window geometry coordinates.<br>
> + See set_window_geometry.<br>
> +<br>
> + The compositor can use this information to allow or disallow<br>
> + different states like maximize or fullscreen and draw accurate<br>
> + animations.<br>
> +<br>
> + Similarly, a tiling window manager may use this information to<br>
> + place and resize client windows in a more effective way.<br>
> +<br>
> + If never set, the minimum size of the window is not limited by<br>
> + the client.<br>
> +<br>
> + A value of zero in the request for either width, height or both<br>
> + means that the client has no expected minimum size in the given<br>
> + dimension. As a result, a client wishing to reset the minimum size<br>
> + to an unspecified state can use zero for width and height in the<br>
> + request.<br>
> + </description><br>
> + <arg name="width" type="int"/><br>
> + <arg name="height" type="int"/><br>
> + </request><br>
> +<br>
> <request name="set_maximized"><br>
> <description summary="maximize the window"><br>
> Maximize the surface.<br>
> --<br>
> 2.5.5<br>
><br>
<br>
<br>
<br>
--<br>
Jasper<br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org" target="_blank">wayland-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/wayland-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</blockquote></div>