After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 735452 - Misbehaviors when placing desync subsurfaces
Misbehaviors when placing desync subsurfaces
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: wayland
git master
Other Mac OS
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2014-08-26 14:39 UTC by Carlos Garnacho
Modified: 2014-09-02 10:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
surface: Don't calculate geometry for buffer-less subsurfaces (1.21 KB, patch)
2014-08-26 14:40 UTC, Carlos Garnacho
committed Details | Review
wayland-surface: Update subsurface position within subsurface_surface_commit (1.82 KB, patch)
2014-08-26 14:40 UTC, Carlos Garnacho
rejected Details | Review

Description Carlos Garnacho 2014-08-26 14:39:43 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.
Comment 1 Carlos Garnacho 2014-08-26 14:40:10 UTC
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.
Comment 2 Carlos Garnacho 2014-08-26 14:40:14 UTC
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.
Comment 3 Jasper St. Pierre (not reading bugmail) 2014-08-26 14:45:33 UTC
(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
Comment 4 Jasper St. Pierre (not reading bugmail) 2014-08-26 14:46:00 UTC
Review of attachment 284512 [details] [review]:

Not spec'd behavior.
Comment 5 Jasper St. Pierre (not reading bugmail) 2014-08-26 14:48:57 UTC
Review of attachment 284511 [details] [review]:

Nice catch.
Comment 6 Carlos Garnacho 2014-08-26 15:32:57 UTC
Attachment 284511 [details] pushed as e822e51 - surface: Don't calculate geometry for buffer-less subsurfaces
Comment 7 Carlos Garnacho 2014-09-02 10:01:58 UTC
A fix went eventually to GTK+ in order to get subsurface positioning committed as parent surface state. This can be closed now.