GNOME Bugzilla – Bug 731494
wayland: Misplacement of nested subsurfaces
Last modified: 2015-01-29 03:47:18 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
Created attachment 278240 [details] The output in weston -- right
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).
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.
Oh, I didn't notice that. So it is weston that should be fixed?
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.
*** Bug 743617 has been marked as a duplicate of this bug. ***
Reported upstream bug https://bugs.freedesktop.org/show_bug.cgi?id=88857 about the issue.