<div dir="ltr"><div>I don't like it but, sure, it shouldn't break anything much further.<br></div>--Jason<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 30, 2014 at 2:10 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>
If a client does this:<br>
1. create a main window and map it<br>
2. create a wl_surface, and make it a sub-surface of the main window<br>
3. set the sub-surface to desync<br>
4. commit content to the sub-surface to map it<br>
<br>
Then step 4 should cause the sub-surface to become mapped. However,<br>
Weston fails to schedule a repaint in that case, so the sub-surface will<br>
not appear until something else causes a repaint on that output, e.g.<br>
the main window.<br>
<br>
A quick and dirty fix is to set the output mask for the surface in<br>
Weston, which allows the repaint to be scheduled. This patch implements<br>
that, and might only work right on single-output systems.<br>
<br>
A proper fix would involve rewriting the whole "is surface mapped"<br>
mechanism in Weston, to not rely on output assignments but to have a<br>
separate flag for "mapped", and figuring out how to schedule repaints<br>
for the right outputs.<br>
<br>
Following is the actual protocol sequence used to trigger the problem:<br>
<br>
[3224648.125] -> wl_compositor@4.create_surface(new id wl_surface@3)<br>
[3224648.206] -> xdg_shell@7.get_xdg_surface(new id xdg_surface@8, wl_surface@3)<br>
[3224648.311] -> xdg_surface@8.set_title("simple-shm")<br>
[3224648.378] -> wl_surface@3.damage(0, 0, 250, 250)<br>
[3224649.888] -> wl_shm@6.create_pool(new id wl_shm_pool@9, fd 6, 250000)<br>
[3224650.031] -> wl_shm_pool@9.create_buffer(new id wl_buffer@10, 0, 250, 250, 1000, 1)<br>
[3224650.244] -> wl_shm_pool@9.destroy()<br>
[3224651.975] -> wl_surface@3.attach(wl_buffer@10, 0, 0)<br>
[3224652.100] -> wl_surface@3.damage(20, 20, 210, 210)<br>
[3224652.243] -> wl_surface@3.frame(new id wl_callback@11)<br>
[3224652.317] -> wl_surface@3.commit()<br>
[3228652.535] -> wl_compositor@4.create_surface(new id wl_surface@12)<br>
[3228652.610] -> wl_subcompositor@5.get_subsurface(new id wl_subsurface@13, wl_surface@12, wl_surface@3)<br>
[3228652.644] -> wl_subsurface@13.set_desync()<br>
[3228652.659] -> wl_subsurface@13.set_position(100, 100)<br>
[3228654.090] -> wl_shm@6.create_pool(new id wl_shm_pool@14, fd 6, 250000)<br>
[3228654.140] -> wl_shm_pool@14.create_buffer(new id wl_buffer@15, 0, 250, 250, 1000, 1)<br>
[3228654.180] -> wl_shm_pool@14.destroy()<br>
[3228654.408] -> wl_surface@12.attach(wl_buffer@15, 0, 0)<br>
[3228654.436] -> wl_surface@12.damage(0, 0, 250, 250)<br>
[3228654.462] -> wl_surface@12.commit()<br>
<br>
Signed-off-by: Pekka Paalanen <<a href="mailto:pekka.paalanen@collabora.co.uk">pekka.paalanen@collabora.co.uk</a>><br>
Cc: George Kiagiadakis <<a href="mailto:george.kiagiadakis@collabora.com">george.kiagiadakis@collabora.com</a>><br>
Cc: Jason Ekstrand <<a href="mailto:jason.ekstrand@intel.com">jason.ekstrand@intel.com</a>><br>
<br>
---<br>
<br>
Do we want this patch in Weston upstream master or even 1.5 stable?<br>
I am not sure when I would have time for the proper fix.<br>
---<br>
src/compositor.c | 11 ++++++++---<br>
1 file changed, 8 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/compositor.c b/src/compositor.c<br>
index fa8730f..d78314a 100644<br>
--- a/src/compositor.c<br>
+++ b/src/compositor.c<br>
@@ -2512,6 +2512,8 @@ subsurface_configure(struct weston_surface *surface, int32_t dx, int32_t dy)<br>
* will not be drawn either.<br>
*/<br>
if (!weston_surface_is_mapped(surface)) {<br>
+ struct weston_output *output;<br>
+<br>
/* Cannot call weston_surface_update_transform(),<br>
* because that would call it also for the parent surface,<br>
* which might not be mapped yet. That would lead to<br>
@@ -2521,11 +2523,14 @@ subsurface_configure(struct weston_surface *surface, int32_t dx, int32_t dy)<br>
* Instead just assing any output, to make<br>
* weston_surface_is_mapped() return true, so that when the<br>
* parent surface does get mapped, this one will get<br>
- * included, too. See surface_list_add().<br>
+ * included, too. See view_list_add().<br>
*/<br>
assert(!wl_list_empty(&compositor->output_list));<br>
- surface->output = container_of(compositor->output_list.next,<br>
- struct weston_output, link);<br>
+ output = container_of(compositor->output_list.next,<br>
+ struct weston_output, link);<br>
+<br>
+ surface->output = output;<br>
+ weston_surface_update_output_mask(surface, 1 << output->id);<br>
}<br>
}<br>
<span class="HOEnZb"><font color="#888888"><br>
--<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>