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 731494 - wayland: Misplacement of nested subsurfaces
wayland: Misplacement of nested subsurfaces
Status: RESOLVED NOTABUG
Product: mutter
Classification: Core
Component: wayland
3.12.x
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2014-06-11 02:06 UTC by Boyan Ding
Modified: 2015-01-29 03:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
subsurface.c -- The test program (6.05 KB, text/x-csrc)
2014-06-11 02:06 UTC, Boyan Ding
Details
The output in weston -- right (14.31 KB, image/png)
2014-06-11 02:07 UTC, Boyan Ding
Details
The output in Gnome -- wrong (8.27 KB, image/png)
2014-06-11 02:09 UTC, Boyan Ding
Details

Description Boyan Ding 2014-06-11 02:06:22 UTC
Created attachment 278239 [details]
subsurface.c -- The test program

I hit the bug accidentally when I was testing a program in a weston bug report[1] under Gnome on Wayland. It will not crash under Gnome but the output is different from that of weston. It seems that only subsurfaces of the root surface is correctly positioned while the nested ones are all placed at (0, 0).

To compile the program:
gcc -D_GNU_SOURCE subsurface.c -o subsurface.o -lwayland-client

Following are the output in weston and gnome.

[1] https://bugs.freedesktop.org/show_bug.cgi?id=79684
Comment 1 Boyan Ding 2014-06-11 02:07:27 UTC
Created attachment 278240 [details]
The output in weston -- right
Comment 2 Boyan Ding 2014-06-11 02:09:33 UTC
Created attachment 278241 [details]
The output in Gnome -- wrong

The four bigest square are correctly placed while other squares (they are nested in other subsurfaces) are misplaced at (0, 0).
Comment 3 Jasper St. Pierre (not reading bugmail) 2014-06-11 13:36:46 UTC
This seems to be correct behavior to me.

The protocol says: http://cgit.freedesktop.org/wayland/wayland/tree/protocol/wayland.xml#n1972

"""
The next wl_surface.commit on the parent surface will reset
the sub-surface's position to the scheduled coordinates.
"""

However, the code never calls commit on the parent surface after calling set_position. Adding a call to wl_surface_commit(surface->surface); at the bottom of create_children has the correct behavior.
Comment 4 Boyan Ding 2014-06-11 23:49:09 UTC
Oh, I didn't notice that. So it is weston that should be fixed?
Comment 5 Jasper St. Pierre (not reading bugmail) 2014-06-12 00:04:57 UTC
We're not sure yet. I talked to Pekka about it in-depth today. Apparently Pekka intended it to mean "any possible parent that gets committed", but I didn't. We tried thinking of what the best choice would be, but we got ridiculously confused among ourselves about all the nesting and synchronizing.
Comment 6 Jasper St. Pierre (not reading bugmail) 2015-01-28 06:35:28 UTC
*** Bug 743617 has been marked as a duplicate of this bug. ***
Comment 7 Jonas Ådahl 2015-01-29 03:47:18 UTC
Reported upstream bug https://bugs.freedesktop.org/show_bug.cgi?id=88857 about the issue.