GNOME Bugzilla – Bug 735452
Misbehaviors when placing desync subsurfaces
Last modified: 2014-09-02 10:01:58 UTC
Running the patches from bug #695504 on mutter --wayland, I first observed mutter crashing at the time of calculating the geometry for the subsurface, when no buffer had been given yet. After fixing that first bug, I also saw desync windows not being properly placed until the parent window received a commit(), apparently subsurfaces only get the position given through wl_subsurface_set_position() in that situation, a behavior that seems to have leaked from sync subsurfaces into desync ones. I'm attaching 2 patches for these, with these, subsurfaces are placed on mutter just as on weston.
Created attachment 284511 [details] [review] surface: Don't calculate geometry for buffer-less subsurfaces A wl_surface may have a wl_subsurface interface, but no buffers attached yet, even though the geometry calculation code for surfaces/subsurfaces assumes everything has already a buffer. Just skip subsurfaces that don't have a buffer, those can't be set a geometry yet, and right now it's crashing accessing the texture from the NULL surface->buffer.
Created attachment 284512 [details] [review] wayland-surface: Update subsurface position within subsurface_surface_commit This ensures that surface->sub.pending_x/y gets applied properly on desync subsurfaces, while still being applied when the parent surface is committed on sync surfaces.
(In reply to comment #0) > After fixing that first bug, I also saw desync windows not being properly > placed until the parent window received a commit(), apparently subsurfaces only > get the position given through wl_subsurface_set_position() in that situation, > a behavior that seems to have leaked from sync subsurfaces into desync ones. This is intentional. sync/desync are about when new buffers are presented, not positions. The spec is very clear about this: """ The next wl_surface.commit on the parent surface will reset the sub-surface's position to the scheduled coordinates. """ http://cgit.freedesktop.org/wayland/wayland/tree/protocol/wayland.xml#n1997
Review of attachment 284512 [details] [review]: Not spec'd behavior.
Review of attachment 284511 [details] [review]: Nice catch.
Attachment 284511 [details] pushed as e822e51 - surface: Don't calculate geometry for buffer-less subsurfaces
A fix went eventually to GTK+ in order to get subsurface positioning committed as parent surface state. This can be closed now.