<div dir="ltr"><div>Yeah, I think this looks ok.<br><br></div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, Jul 28, 2014 at 4:06 AM, Pekka Paalanen <span dir="ltr"><<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
From: Pekka Paalanen <<a href="mailto:pekka.paalanen@collabora.co.uk">pekka.paalanen@collabora.co.uk</a>><br>
<br>
It looks like that in the great conversion introducing weston_view, one<br>
conditional was forgotten from the code that builds the global flat list<br>
of views. Sub-surfaces are added to the view list specially, as they are<br>
not governed by their presence in a layer's view list, and therefore<br>
need an explicit check for mappedness.<br>
<br>
The bug, missing the explicit check, caused sub-surfaces to enter the<br>
global view_list regardless of their state. This lead to the pointer<br>
focus picking code processing them, and as the input region defaults to<br>
infinite, picking these unmapped surfaces. Clients then get confused<br>
about the wl_pointer.enter events with unexpected wl_surface.<br>
<br>
To trigger this issue, it is enough to just create one additional<br>
wl_surface and make it a sub-surface of a main surface that is or gets<br>
mapped. Literally, just a wl_subsomcpositor_get_subsurface() call is<br>
enough. At some point later, the unmapped sub-surface will get pointer<br>
focus, depending on view stacking order.<br>
<br>
Fix the issue by adding a is_mapped check when building the view_list.<br>
<br>
Note, that 95ec0f95aa2df74c2da19e7dda24528fa8f765cc accidentally also<br>
prevents this bug from happening, because it adds a test against the<br>
transform.masked_boundingbox in weston_compositor_pick_view().<br>
<br>
Reported-by: George Kiagiadakis <<a href="mailto:george.kiagiadakis@collabora.com">george.kiagiadakis@collabora.com</a>><br>
Signed-off-by: Pekka Paalanen <<a href="mailto:pekka.paalanen@collabora.co.uk">pekka.paalanen@collabora.co.uk</a>><br>
Cc: Jason Ekstrand <<a href="mailto:jason.ekstrand@intel.com">jason.ekstrand@intel.com</a>><br>
---<br>
src/compositor.c | 3 +++<br>
1 file changed, 3 insertions(+)<br>
<br>
diff --git a/src/compositor.c b/src/compositor.c<br>
index 02f569f..1e17583 100644<br>
--- a/src/compositor.c<br>
+++ b/src/compositor.c<br>
@@ -1751,6 +1751,9 @@ view_list_add_subsurface_view(struct weston_compositor *compositor,<br>
struct weston_subsurface *child;<br>
struct weston_view *view = NULL, *iv;<br>
<br>
+ if (!weston_surface_is_mapped(sub->surface))<br>
+ return;<br>
+<br>
wl_list_for_each(iv, &sub->unused_views, surface_link) {<br>
if (iv->geometry.parent == parent) {<br>
view = iv;<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.5.5<br>
<br>
_______________________________________________<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>
</font></span></blockquote></div><br></div>