frame callbacks and sub_surfaces

Pekka Paalanen ppaalanen at gmail.com
Fri Nov 4 08:32:15 UTC 2022


On Thu, 3 Nov 2022 15:14:00 -0700
Joel Winarske <joel.winarske at gmail.com> wrote:

> Hi pq,
> 
> I was thinking of a more full-featured example using sub surfaces with
> runtime positioning and z-order control.
> 
> That aside I am having an interesting problem.  In case of multiple
> surfaces, I only see the frame event for the last added surface.
> 
> Surface A is behind B and C (tiled), none occluded.
> 
> Here I get a frame callback for B. I'm using the commit pattern from B to
> Base.
> Surface B
> Surface A
> Base
> 
> Adding sub surface C, with registered callbacks for B and C, I only see a
> frame callback for C.  I'm using the commit pattern from C to Base.
> Surface C
> Surface B
> Surface A
> Base
> 
> I don't touch the B callback when the C callback is added.

Please, be more specific about which requests and when you are sending.
From the above, I can guess the wl_surface.commit requests, but I do
not see when exactly you do e.g. wl_surface.frame and on which surface.

> Does anything stand out?

The only guess I have is that you missed this part from
wl_surface.frame specification:

> The notification will only be posted for one frame unless requested
> again.

and

> The object returned by this request will be destroyed by the
> compositor after the callback is fired and as such the client must
> not attempt to use it after that point.

So every time you want to receive a frame callback, you need to create
a new wl_callback object with wl_surface.frame. And every time
wl_callback.done is delivered, you must destroy the wl_callback.

You can also destroy the wl_callback at any time, if you are no longer
interested in it.


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20221104/0eb2eb7e/attachment.sig>


More information about the wayland-devel mailing list