[PATCH 1/2] RDP compositor: make the seat dynamic and don't destroy it on removal

Pekka Paalanen ppaalanen at gmail.com
Tue May 19 02:20:08 PDT 2015


On Tue, 19 May 2015 10:07:39 +0200
David FORT <rdp.effort at gmail.com> wrote:

> This patch makes the seat dynamic and leak it on purpose during seat removal to
> prevent the ghost object case.
> ---
>  src/compositor-rdp.c | 39 +++++++++++++++++++++++++++------------
>  1 file changed, 27 insertions(+), 12 deletions(-)
> 
> diff --git a/src/compositor-rdp.c b/src/compositor-rdp.c
> index 3185141..f1dcda0 100644
> --- a/src/compositor-rdp.c
> +++ b/src/compositor-rdp.c
> @@ -105,7 +105,7 @@ enum peer_item_flags {
>  struct rdp_peers_item {
>  	int flags;
>  	freerdp_peer *peer;
> -	struct weston_seat seat;
> +	struct weston_seat *seat;
>  
>  	struct wl_list link;
>  };
> @@ -606,6 +606,7 @@ static void
>  rdp_peer_context_free(freerdp_peer* client, RdpPeerContext* context)
>  {
>  	int i;
> +	struct weston_seat *seat;
>  	if (!context)
>  		return;
>  
> @@ -616,9 +617,17 @@ rdp_peer_context_free(freerdp_peer* client, RdpPeerContext* context)
>  	}
>  
>  	if (context->item.flags & RDP_PEER_ACTIVATED) {
> -		weston_seat_release_keyboard(&context->item.seat);
> -		weston_seat_release_pointer(&context->item.seat);
> -		weston_seat_release(&context->item.seat);
> +		seat = context->item.seat;
> +		weston_seat_release_keyboard(seat);
> +		weston_seat_release_pointer(seat);
> +
> +		/* picked from weston_seat_release(context->item.seat); */
> +		wl_list_remove(&seat->link);
> +		if (seat->saved_kbd_focus)
> +			wl_list_remove(&seat->saved_kbd_focus_listener.link);
> +		wl_global_destroy(seat->global);

Hi,

are you sure destroying the global is ok? Ah, but the thing you want to
keep are the *existing* protocol objects.

I'd like to have a little more explanation in the code comment on why
this is so strangely coded, and what it actually achieves.

> +		wl_signal_emit(&seat->destroy_signal, seat);
> +

Feel free to add that comment and push. These two patches are
Acked-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

I think it is ok to land these before RC2.


Thanks,
pq


More information about the wayland-devel mailing list