[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:50:39 PDT 2015


On Tue, 19 May 2015 11:39:24 +0200
Hardening <rdp.effort at gmail.com> wrote:

> Le 19/05/2015 11:20, Pekka Paalanen a écrit :
> > 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 {
> 
> [...]
> >> +		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 have picked code weston_seat_release() from that was releasing things
> in the seat without freeing it, but...

I was more looking an answer for the questions *why* do you want a
modified version of weston_seat_release(), and *how* it changes the end
result from normal.

> Thinking of it, it's really a bad idea to destroy the global, it could
> cause clients to be disconnected if they try to do anything with the
> seat. We're really lacking the release event...

But you are only destroying the global advertisement, which causes
sending out wl_registry.global_remove events and prevents the global
from being advertised again. I think that is what you want, no?

It won't destroy already created protocol objects, e.g. those created
by binding to the global. Right?

I'm going on a old memory here...


Thanks,
pq


More information about the wayland-devel mailing list