<div dir="ltr"><div><div><div><div>Hi Guilio,<br><br>In fact, the client will be hidden anyway, because in order to keep some consistency, the compositor will hide it :<br><br>"set_minimized()" function in "shell.c" : <br>
<a href="https://github.com/Tarnyko/weston-taskbar/blob/1.4.0-taskbar/desktop-shell/shell.c#L3385">https://github.com/Tarnyko/weston-taskbar/blob/1.4.0-taskbar/desktop-shell/shell.c#L3385</a><br><br></div>What the client does, here, is that it knows it has been mimimized, and will handle in a specific way (slowing its rendering down, e.g.). <br>
<br></div>It seemed like a good compromise between some opinions expressed before : server-side or client-side. Here the server-side will hide the window, but the client-side *may* do some useful stuff.<br><br>I may be wrong of course, and in that case we could just handle this server-side (the code just did this before).<br>
<br></div>Regards<br></div>Tarnyko,<br><div class="gmail_extra"><br><br><div class="gmail_quote">2014-02-10 16:33 GMT+01:00 Giulio Camuffo <span dir="ltr"><<a href="mailto:giuliocamuffo@gmail.com" target="_blank">giuliocamuffo@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">2014-02-10 17:25 GMT+02:00 Manuel Bachmann<br>
<<a href="mailto:manuel.bachmann@open.eurogiciel.org">manuel.bachmann@open.eurogiciel.org</a>>:<br>
<div class="">> Hi Bill, hi Jasper, hi everybody again,<br>
><br>
> I just updated my taskbar code to make it work against Weston 1.4.0 :<br>
> <a href="https://github.com/Tarnyko/weston-taskbar/tree/1.4.0-taskbar" target="_blank">https://github.com/Tarnyko/weston-taskbar/tree/1.4.0-taskbar</a><br>
><br>
> And with regards to our former conversation, I added a logic that allows the<br>
> client to "know" when it has been minimized :<br>
> <a href="https://github.com/Tarnyko/weston-taskbar/commit/7b456ef103e9dd0e37d7cf74e55d87f7ffa64be9" target="_blank">https://github.com/Tarnyko/weston-taskbar/commit/7b456ef103e9dd0e37d7cf74e55d87f7ffa64be9</a><br>
><br>
> Here is how it works :<br>
><br>
> - there are 2 new compositor-to-client requests in "xdg_shell.xml" (not<br>
> upstream, added them for the demo) :<br>
> xdg_surface_request_set_minimized<br>
> xdg_surface_request_unset_minimized<br>
><br>
> - when a client using toytoolkit (weston-terminal for instance) wants to be<br>
> minimized, he asks the compositor :<br>
> xdg_surface_set_minimized(xdg_surface);<br>
><br>
> - the compositor handles this with its own logic. In my current<br>
> implementation, he hides it from view, but the code is in #ifdef<br>
> HAVE_TASKBAR and he could very well do anything else ;<br>
><br>
> - when the compositor is done, he tells the client surface it has been<br>
> minimized by sending :<br>
> xdg_surface_send_request_set_minimized(shsurf->resource);<br>
><br>
> - the client gets its answer in :<br>
> xdg_surface_request_set_minimized( ... ) { .... }<br>
<br>
</div>I don't think that's a good idea. If i click on the taskbar I want the<br>
client to hide, even if it doesn't call the<br>
xdg_surface_request_set_minimized for any reason (it's frozen, it's<br>
broken, ...). It may make sense to send an event telling the client it<br>
has been minimized, thought it should not mean the client can stop<br>
rendering.<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> and in the specific case of toytoolkit, decides to suspend the redraw with :<br>
><br>
> window_defer_redraw_until_configure (window);<br>
><br>
> So it doesn't consume too much CPU until it's unminimized again.<br>
><br>
> - if later, the surface would be un-mimimized, then the client would get the<br>
> answer with "request_unset_minimized()" and redraw its surface with :<br>
> window_schedule_redraw (window);<br>
><br>
> So a video player, for example, could cpntinue playing sound but avoid<br>
> decoding some frames.<br>
><br>
> BTW, if you remove the last commit of my code, the logic is compositor-only,<br>
> but with this commit, it becomes a kind of communication :<br>
> "client->compositor->shell" / "shell->compositor->client".<br>
><br>
> What do you think of this ?<br>
><br>
> Regards,<br>
> Manuel<br>
><br>
> -<br>
><br>
><br>
> 2014-01-31 7:11 GMT+01:00 Bill Spitzak <<a href="mailto:spitzak@gmail.com">spitzak@gmail.com</a>>:<br>
><br>
>><br>
>><br>
>> Jasper St. Pierre wrote:<br>
>><br>
>>> A toolbox over a painting program that has two documents open.<br>
>>><br>
>>> So, what is the expected behavior here exactly? There's a minimize button<br>
>>> on both of the content window's decorations, and clicking on one should<br>
>>> minimize all three windows?<br>
>><br>
>><br>
>> Clicking minimize of one of the documents makes only the document<br>
>> disappear. But then clicking on the minimize of the other document makes<br>
>> both the document and toolbox disappear.<br>
>><br>
>><br>
>>> What should using the "minimize keyboard shortcut" functionality of your<br>
>>> compositor do? Should it differ from using the button in the UI? What does<br>
>>> it do right now on X11 or other platforms?<br>
>><br>
>><br>
>> It should do EXACTLY the same thing as a minimize button. Any different<br>
>> behavior is a bug.<br>
>><br>
>><br>
>>> A client can ignore attempts to close it with the close box.<br>
>>><br>
>>> Are you talking about simply having a minimize button in the server-side<br>
>>> decoration that does nothing? Or are you talking about the compositor<br>
>>> forcibly minimizing a window with e.g. a keyboard shortcut?<br>
>>><br>
>>> The former is an application bug (the button does nothing because it was<br>
>>> wired to do nothing), and while it's certainly frustrating from a user<br>
>>> perspective, the compositor can still forcibly minimize or close the window.<br>
>><br>
>><br>
>> I would expect that a compositor shortcut key to close a window would<br>
>> first try sending a message to the app saying it wants to close, and the app<br>
>> can decide to not close (ideally by asking the user if they are sure, and<br>
>> the user says no). If it just killed the app or destroyed the window that<br>
>> could be very user-unfriendly and I am rather suprised anybody would suggest<br>
>> that.<br>
>><br>
>> If an app is non-cooperative the compositor can do some stuff. For close<br>
>> it can kill the client if it is not responding to pings. Minimize probably<br>
>> should also force-hide the surface after a timeout even if the client is<br>
>> responding to pings. However this fallback stuff should not be part of the<br>
>> Wayland api and can be left up to the compositor writers to decide.<br>
>><br>
><br>
><br>
><br>
> --<br>
> Regards,<br>
><br>
> Manuel BACHMANN<br>
> Tizen Project<br>
> VANNES-FR<br>
><br>
</div></div><div class="HOEnZb"><div class="h5">> _______________________________________________<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" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><font>Regards,<br>
<br>
<i><b>Manuel BACHMANN</b><br>
Tizen Project<br>
VANNES-FR</i><br>
</font></div>
</div></div>