<div dir="ltr">The point is just to ensure focus notification is sent after the surface ID is, you may remember the CloggableEventSink...this was the solution after that got rejected.<br></div><div class="gmail_extra"><br>
<br><div class="gmail_quote">On Tue, Apr 1, 2014 at 9:30 AM, Alan Griffiths <span dir="ltr"><<a href="mailto:alan.griffiths@canonical.com" target="_blank">alan.griffiths@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
In my trawl through the data model I came across
handle_surface_created() and wondered exactly what problem it
solves.<br>
<br>
I suspect the "scene" rework will offer a better solution, but I'd
like to understand what's going on before proposing anything.<br>
<br>
Firstly, note that <b>this function is not the subject of any tests</b>.
So changes that break the required behaviour will not cause test
failures.<br>
<br>
Now, from mf::SessionMediator::create_surface()<br>
<br>
// TODO: NOTE: We use the ordering here to ensure the
shell acts on the surface after the surface ID is sent over the
wire.<br>
// This guarantees that notifications such as, gained
focus, etc, can be correctly interpreted by the client.<br>
// To achieve this order we rely on done->Run()
sending messages synchronously. As documented in
mfd::SocketMessenger::send.<br>
// this will require additional synchronization if
mfd::SocketMessenger::send changes.<br>
<br>
And the active code is:<br>
<blockquote>void
ms::SessionManager::handle_surface_created(std::shared_ptr<mf::Session>
const& session)<br>
{<br>
auto shell_session =
std::dynamic_pointer_cast<msh::Session>(session);<br>
<br>
set_focus_to(shell_session);<br>
}<br>
</blockquote>
So, it appears to be a mechanism for setting the focus to the
session that owns a surface <i>after</i> the surface data has been
sent to the client. Except that we also call it from mf::SurfaceId
ms::SessionManager::create_surface_for()<br>
<blockquote>// TODO: We use this to work around the lack of a
SessionMediator-like object for internal clients.<br>
// we could have an internal client mediator which acts as a
factory for internal clients, taking responsibility<br>
// for invoking handle_surface_created.<br>
</blockquote>
In any case, the requirement appears to be that to focus on a
session immediately a new surface in the session is known to the
client.<br>
<br>
I assume this is so that input can be routed to the surface before
it is visible? (That surface hasn't yet posted a frame so it is not
available to be rendered.)<br>
</div>
<br>--<br>
Mir-devel mailing list<br>
<a href="mailto:Mir-devel@lists.ubuntu.com">Mir-devel@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/mir-devel" target="_blank">https://lists.ubuntu.com/mailman/listinfo/mir-devel</a><br>
<br></blockquote></div><br></div>