<div dir="ltr"><div><div><div><div><div><div><div><div>Hi Bill, hi Jasper, hi everybody again,<br><br></div>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">https://github.com/Tarnyko/weston-taskbar/tree/1.4.0-taskbar</a><br>
<br></div>And with regards to our former conversation, I added a logic that allows the client to "know" when it has been minimized :<br><a href="https://github.com/Tarnyko/weston-taskbar/commit/7b456ef103e9dd0e37d7cf74e55d87f7ffa64be9">https://github.com/Tarnyko/weston-taskbar/commit/7b456ef103e9dd0e37d7cf74e55d87f7ffa64be9</a><br>
<br></div>Here is how it works :<br><br></div>- there are 2 new compositor-to-client requests in "xdg_shell.xml" (not upstream, added them for the demo) :<br></div>xdg_surface_request_set_minimized<br>xdg_surface_request_unset_minimized<br>
<br></div>- when a client using toytoolkit (weston-terminal for instance) wants to be minimized, he asks the compositor :<br></div>xdg_surface_set_minimized(xdg_surface);<br><br></div>- the compositor handles this with its own logic. In my current implementation, he hides it from view, but the code is in #ifdef HAVE_TASKBAR and he could very well do anything else ;<br>
<div><div><div><br></div><div>- when the compositor is done, he tells the client surface it has been minimized by sending :<br></div><div>xdg_surface_send_request_set_minimized(shsurf->resource);<br></div><div><br></div>
<div>- the client gets its answer in :<br></div><div>xdg_surface_request_set_minimized( ... ) { .... }<br><br>and in the specific case of toytoolkit, decides to suspend the redraw with :<br></div><div><br></div><div>window_defer_redraw_until_configure (window);<br>
<br></div><div>So it doesn't consume too much CPU until it's unminimized again.<br></div><div><br></div><div>- if later, the surface would be un-mimimized, then the client would get the answer with "request_unset_minimized()" and redraw its surface with :<br>
</div><div>window_schedule_redraw (window);<br></div><div><br></div><div>So a video player, for example, could cpntinue playing sound but avoid decoding some frames. <br></div><div><br></div><div>BTW, if you remove the last commit of my code, the logic is compositor-only, but with this commit, it becomes a kind of communication : "client->compositor->shell" / "shell->compositor->client".<br>
<br></div><div>What do you think of this ?<br></div><div><br></div><div>Regards,<br>Manuel<br></div><div><div><br>- <br></div></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-01-31 7:11 GMT+01:00 Bill Spitzak <span dir="ltr"><<a href="mailto:spitzak@gmail.com" target="_blank">spitzak@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><br>
<br>
Jasper St. Pierre wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
    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 on both of the content window's decorations, and clicking on one should minimize all three windows?<br>
</blockquote>
<br></div>
Clicking minimize of one of the documents makes only the document disappear. But then clicking on the minimize of the other document makes both the document and toolbox disappear.<div class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
What should using the "minimize keyboard shortcut" functionality of your compositor do? Should it differ from using the button in the UI? What does it do right now on X11 or other platforms?<br>
</blockquote>
<br></div>
It should do EXACTLY the same thing as a minimize button. Any different behavior is a bug.<div class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
    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 decoration that does nothing? Or are you talking about the compositor 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 wired to do nothing), and while it's certainly frustrating from a user perspective, the compositor can still forcibly minimize or close the window.<br>

</blockquote>
<br></div>
I would expect that a compositor shortcut key to close a window would first try sending a message to the app saying it wants to close, and the app can decide to not close (ideally by asking the user if they are sure, and the user says no). If it just killed the app or destroyed the window that could be very user-unfriendly and I am rather suprised anybody would suggest that.<br>

<br>
If an app is non-cooperative the compositor can do some stuff. For close it can kill the client if it is not responding to pings. Minimize probably should also force-hide the surface after a timeout even if the client is responding to pings. However this fallback stuff should not be part of the Wayland api and can be left up to the compositor writers to decide.<br>

<br>
</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>