<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Aug 4, 2014 at 8:36 PM, Michael Forney <span dir="ltr"><<a href="mailto:mforney@mforney.org" target="_blank">mforney@mforney.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=""><div class="h5"><div dir="ltr"><div class="gmail_quote"><div dir="ltr"><br><div class="gmail_extra">
<div class="gmail_quote"><div>On Mon, Aug 4, 2014 at 5:29 PM, Jasper St. Pierre <span dir="ltr"><<a href="mailto:jstpierre@mecheye.net" target="_blank">jstpierre@mecheye.net</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Second, how should the compositor deal with a window manager which wants to change the size and position of a window rapidly in succession (for example, the window is moved from one monitor to another, and then to another)?</div>
</div></blockquote><div><br></div></div><div>I don't understand this. The window manager and the compositor are in the same process. Why do you need any synchronization here?</div></div></div></div></blockquote><div>
<br></div></div><div>Sorry, I misspoke. I meant "how should the window manager/compositor handle the case where a user moves a window to several different tiled configurations in rapid succession". Hopefully the rest of the paragraph makes sense with that in mind.</div>
<span><font color="#888888">
</font></span></div><span><font color="#888888"></font></span></div></div></div></div></div></div></blockquote><div><br>Ah. This is exactly the goal of the ack_configure
request. When you send out a configure event, you generate a serial and
save it somewhere. When you get the ack_configure request back, you know exactly which buffer that's attached matches whichever configure event that you sent out.<br><br></div><div>If you wanted to be particularly fancy, you can save every position for every move/resize operation, and replay that when you get the properly tagged commit. That would be the most correct solution. However, you don't need to be that fancy.<br>
<br></div><div>When you want to move/resize a window, save the position you wanted to move the window to and serial that you sent out with the configure event. When you get an ack that completes that pending move, update the window's position.<br>
<br></div><div>The pathological case here, is, as you point out, an application lagging behind. This simply might not ever happen in practice: the 16ms you have to repaint your frame should be more than enough for every application. If not, you don't have a new buffer to paint, only the old one, which means you have two possibilities: show the old buffer at the old location, or show the old buffer at the new location.<br>
<br>If you're that concerned about this, then some simple trial and error with a hand-written pathological client that takes half a second after a configure to redraw might provide some insight into which one of the two alternatives looks better to a user.<br>
</div><br><div>And hey, since you're writing a tiling WM, you also don't have to deal with the particularly tricky case of interactive resizing, in which the new position of the window is resizing an edge based on the size of the new buffer, which can't be calculated ahead of time. That's where a good part of the complexity of the code in mutter and weston comes from.<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=""><div class="h5"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">
<div class="gmail_extra"><span><font color="#888888">-- <br>Michael Forney <<a href="mailto:mforney@mforney.org" target="_blank">mforney@mforney.org</a>>
</font></span></div></div>
</div></div>
</div></div></blockquote></div><br><br clear="all"><br>-- <br> Jasper<br>
</div></div>