<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Nov 22, 2015 at 4:19 PM, Peter Hutterer <span dir="ltr"><<a href="mailto:peter.hutterer@who-t.net" target="_blank">peter.hutterer@who-t.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
p1.leave, p2.leave, \<br>
p1.enter, p2.enter,\<br>
p1.frame *FOCUS TRANSITIONED*, p2.frame *FOCUS TRANSITIONED*<br>
<br>
we have the same issue where two surfaces are focused simultaneously though<br>
at least in this case it's detectable. I don't know how much of an issue<br>
this is in the real world, Carlos may have more feedback here.<br></blockquote><div><br></div><div>If there are two pointers, then having both surfaces focused simultaneously is possible anyway, so I don't see how this is a problem.<br><br></div><div>I am assuming a client will just wait for the frame events and not do anything until that happens. The fact that it got enter/leave events does nothing visible to code outside the very low levels so the interleaving is not a problem. An extremely simplified example of the style of code I expect clients to use:<br><br></div><div> struct ToolkitWindow;<br></div><div> void (*focusIsNowHere)(ToolkitWindow*, seat); // callback from the toolkit<br></div><div><br></div><div> toolkit_event_handler() {<br></div><div> static ToolkitWindow* currentFocus[2];<br></div><div> static ToolkitWindow* requestedFocus[2]; // This array in particular cannot be seen by outside code!<br> ...<br></div><div> case wl_pointer.enter:<br></div><div> requestedFocus[seat] = findWindow(surface);<br></div><div> break;<br></div><div> case wl_pointer.exit:<br></div><div> requestedFocus[seat] = NULL;<br></div><div> break;<br></div><div> case wl_pointer.frame:<br></div><div> if (requestedFocus[seat] != currentFocus[seat]) {<br></div><div> currentFocus[seat] = requesetedFocus[seat];<br></div><div> focusIsNowHere(requestedFocus[seat], seat);<br> }<br></div><div> break;<br> ...<br><br></div><div>I find it hard to imagine any client being implemented differently than this so I really don't see the problem.<br><br></div></div><br></div></div>