compositor: quick fix for sub-surface mapping

Graphics / Wayland / Weston - Pekka Paalanen [collabora.co.uk] - 25 July 2014 07:08 UTC

If a client does this: 1. create a main window and map it 2. create a wl_surface, and make it a sub-surface of the main window 3. set the sub-surface to desync 4. commit content to the sub-surface to map it

Then step 4 should cause the sub-surface to become mapped. However, Weston fails to schedule a repaint in that case, so the sub-surface will not appear until something else causes a repaint on that output, e.g. the main window.

A quick and dirty fix is to set the output mask for the surface in Weston, which allows the repaint to be scheduled. This patch implements that, and might only work right on single-output systems.

A proper fix would involve rewriting the whole "is surface mapped" mechanism in Weston, to not rely on output assignments but to have a separate flag for "mapped", and figuring out how to schedule repaints for the right outputs.

Following is the actual protocol sequence used to trigger the problem:

[3224648.125] -> wl_compositor@4.create_surface(new id wl_surface@3) [3224648.206] -> xdg_shell@7.get_xdg_surface(new id xdg_surface@8, wl_surface@3) [3224648.311] -> xdg_surface@8.set_title("simple-shm") [3224648.378] -> wl_surface@3.damage(0, 0, 250, 250) [3224649.888] -> wl_shm@6.create_pool(new id wl_shm_pool@9, fd 6, 250000) [3224650.031] -> wl_shm_pool@9.create_buffer(new id wl_buffer@10, 0, 250, 250, 1000, 1) [3224650.244] -> wl_shm_pool@9.destroy() [3224651.975] -> wl_surface@3.attach(wl_buffer@10, 0, 0) [3224652.100] -> wl_surface@3.damage(20, 20, 210, 210) [3224652.243] -> wl_surface@3.frame(new id wl_callback@11) [3224652.317] -> wl_surface@3.commit() [3228652.535] -> wl_compositor@4.create_surface(new id wl_surface@12) [3228652.610] -> wl_subcompositor@5.get_subsurface(new id wl_subsurface@13, wl_surface@12, wl_surface@3) [3228652.644] -> wl_subsurface@13.set_desync() [3228652.659] -> wl_subsurface@13.set_position(100, 100) [3228654.090] -> wl_shm@6.create_pool(new id wl_shm_pool@14, fd 6, 250000) [3228654.140] -> wl_shm_pool@14.create_buffer(new id wl_buffer@15, 0, 250, 250, 1000, 1) [3228654.180] -> wl_shm_pool@14.destroy() [3228654.408] -> wl_surface@12.attach(wl_buffer@15, 0, 0) [3228654.436] -> wl_surface@12.damage(0, 0, 250, 250) [3228654.462] -> wl_surface@12.commit()

eb3cf22 compositor: quick fix for sub-surface mapping
src/compositor.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

Upstream: cgit.freedesktop.org


  • Share