<div dir="ltr"><div>Hi Derek, and thanks a lot for your feedback,<br><br></div>I think it makes sense if you consider the compositor can know if a past input event could have happened "not long ago" or "a very long time ago" (if the event happened not long ago, raise the window, otherwise blink). It is really a matter of policy, but the idea was to let the shell know some details on user interactions, so it can decide what to do. What do you think of this ?<br><br>PS : I rebased the patches on top of Weston 1.9 *. I am also preparing a demonstration using well-known applications with external toolkits, but it takes some time.<br><br><div>* : <a href="https://github.com/Tarnyko/weston-xdg_surface_present">https://github.com/Tarnyko/weston-xdg_surface_present</a><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">Regards,<br><span><div><div dir="ltr"><span><font color="#888888"><div><i><small>Manuel Bachmann, Graphics Engineer<br>
<a href="http://iot.bzh" target="_blank"> www.iot.bzh</a>
</small></i></div>
</font></span><div>
</div></div></div></span><br></div></div></div>
<br><div class="gmail_quote">2015-09-28 22:41 GMT+02:00 Derek Foreman <span dir="ltr"><<a href="mailto:derekf@osg.samsung.com" target="_blank">derekf@osg.samsung.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 09/04/15 11:22 AM, Manuel Bachmann wrote:<br>
> xdg_surface_present() and xdg_surface_present_from_event()<br>
> are new requests supposed to be called on an existing<br>
> xdg_surface. They tell the compositor that the surface<br>
> has new content which may be of interest to the user.<br>
> The compositor may then choose to notify the user.<br>
><br>
> xdg_surface_present_from_event() takes a serial coming<br>
> from an input (wl_keyboard, wl_pointer, wl_touch) event as<br>
> an argument. If the serial is valid and sufficiently recent,<br>
> we can suppose the new content has been issued at the user's<br>
> request ; the compositor may then choose to raise the<br>
> surface directly. Otherwise, it just behaves like present().<br>
<br>
I'm having a hard time thinking of a use case for<br>
xdg_surface_present_from_event()... Picking an arbitrary motion event<br>
from the past seems odd - the compositor probably won't keep track of<br>
input serials in any way that makes this useful?<br>
<br>
> Signed-off-by: Manuel Bachmann <<a href="mailto:manuel.bachmann@open.eurogiciel.org">manuel.bachmann@open.eurogiciel.org</a>><br>
> ---<br>
> desktop-shell/shell.c | 15 +++++++++++++++<br>
> protocol/xdg-shell.xml | 20 ++++++++++++++++++++<br>
> 2 files changed, 35 insertions(+)<br>
><br>
> diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c<br>
> index f7c928e..d1d3f3c 100644<br>
> --- a/desktop-shell/shell.c<br>
> +++ b/desktop-shell/shell.c<br>
> @@ -3923,6 +3923,19 @@ xdg_surface_set_minimized(struct wl_client *client,<br>
> set_minimized(shsurf->surface);<br>
> }<br>
><br>
> +static void<br>
> +xdg_surface_present(struct wl_client *client,<br>
> + struct wl_resource *resource)<br>
> +{<br>
> +}<br>
> +<br>
> +static void<br>
> +xdg_surface_present_from_event(struct wl_client *client,<br>
> + struct wl_resource *resource,<br>
> + uint32_t serial)<br>
> +{<br>
> +}<br>
> +<br>
> static const struct xdg_surface_interface xdg_surface_implementation = {<br>
> xdg_surface_destroy,<br>
> xdg_surface_set_parent,<br>
> @@ -3938,6 +3951,8 @@ static const struct xdg_surface_interface xdg_surface_implementation = {<br>
> xdg_surface_set_fullscreen,<br>
> xdg_surface_unset_fullscreen,<br>
> xdg_surface_set_minimized,<br>
> + xdg_surface_present,<br>
> + xdg_surface_present_from_event,<br>
> };<br>
><br>
> static void<br>
> diff --git a/protocol/xdg-shell.xml b/protocol/xdg-shell.xml<br>
> index 68cf469..10f82c5 100644<br>
> --- a/protocol/xdg-shell.xml<br>
> +++ b/protocol/xdg-shell.xml<br>
> @@ -396,6 +396,26 @@<br>
> </description><br>
> </request><br>
><br>
> + <request name="present"><br>
> + <description summary="the window wants attention from the user"><br>
> + The surface has new content and would like the compositor<br>
> + to notify the user.<br>
> + </description><br>
> + </request><br>
> +<br>
> + <request name="present_from_event"><br>
> + <description summary="the window needs attention from the user"><br>
> + The surface has new content and would like the compositor<br>
> + to notify the user.<br>
> +<br>
> + If a valid and sufficiently recent serial coming from an<br>
> + input (keyboard, pointer, touch) event is passed as an<br>
> + argument, the compositor may want to raise the surface.<br>
> + Otherwise, the request just behaves like the "present" one.<br>
> + </description><br>
> + <arg name="serial" type="uint" summary="serial of an input event"/><br>
> + </request><br>
> +<br>
> <event name="close"><br>
> <description summary="surface wants to be closed"><br>
> The close event is sent by the compositor when the user<br>
><br>
<br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</blockquote></div><br></div>