How to release the weston_buffer after weston_view is destroyed.

Sichem Zhou sichem.zh at
Thu Aug 2 19:44:54 UTC 2018

Dear all,

I solved it using the `frame_signal` in the weston_output. I referenced the
Weston shell  `set_minimized` implementation, which works by moving view to
a hidden layer.  It didn't work for me since I trigger immediately the next
frame once moving the view back to the original layer. The commit can
happen before receiving the last frame done. Which actually happened all
the time.

I hope this mail can also be helpful to others, I found a shell
implementation is really tricky.


Le dim. 29 juill. 2018 20 h 49, Sichem Zhou <sichem.zh at> a écrit :

> I actually found the reason, in the function `weston_output_repaint`, the
> frame_callbacks
> only send the done events for surface which has view on the compositor's
> view_list,
> but this poses a dilemma, since I cannot either destroy or unmap the view
> before the
> output repainted.
> Sichem
> On Sat, Jul 28, 2018 at 8:15 PM, Sichem Zhou <sichem.zh at> wrote:
>> Dear Weston devs:
>> Sorry for the bothering in when weston-5.0 is approaching, but I am stuck
>> in the project for three days I need some one's help very much.
>> I have a widget implementation of shell widgets that destroys the
>> weston_view
>> when pressed Esc. The widget is implemented in wayland EGL. Here is the
>> view_destroy code.
>> void
>> twshell_close_ui_surface(struct weston_surface *wd_surface)
>> {
>>         struct weston_view *view, *next;
>>         wd_surface->committed = NULL;
>>         wd_surface->committed_private = NULL;
>>         wl_list_for_each_safe(view, next, &wd_surface->views,
>> surface_link) {
>>                 weston_view_destroy(view);
>>         }
>> }
>> The weston_view is destroyed but the the buffer in the last commit was
>> not
>> released and the done event was not sent to the widget. When I triggered
>> the event to show widget again, the client was stuck in EGLSwapbuffer. I
>> found out about this by using WAYLAND_DEBUG env variable, I hope to the
>> way to release the buffer after umapping the weston view. Thanks very
>> much.
>> Regards,
>> Sichem
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the wayland-devel mailing list