Globals deletion
Pekka Paalanen
ppaalanen at gmail.com
Fri Nov 15 05:43:03 PST 2013
On Mon, 21 Oct 2013 11:09:46 +0200
Marek Ch <mchqwerty at gmail.com> wrote:
> Hi,
>
> I have got one question. In documentation of wl_registry's global_remove
> event is:
>
> "This event notifies the client that the global identified by name is no
> longer available. If the client bound to the global using the bind request,
> the client should now destroy that object.
> The object remains valid and **requests to the object will be ignored until
> the client destroys it** ... ."
>
> Consider this code (I'll choose wl_seat as a global):
>
>
> DISPLAY CLIENT
> \\ create display, globals, etc.. ....
> .... seat = get
> wl_seat proxy ..
> .... \\
> do something
> wl_global_destroy(seat) ....
> ....
> ....
> ....
> wl_seat_get_pointer(seat)
> ....
> wl_seat_get_touch(seat)
>
> If I understand the documentation correctly then the
> wl_seat_get_{pointer|touch} should be ignored, because these are requests
> to already deleted object. Or am I missing something?
Correct. However, since wl_seat_get_pointer creates a new protocol
object, and the client might not yet know that the wl_seat global is
gone, a new inert wl_pointer protocol object must be created. Otherwise
any requests the client does on the wl_pointer, like 'release', would
lead to a protocol error and disconnecting the client.
Awkward, but I don't see any other way to deal with requests
creating new objects from an inert object.
Thanks,
pq
More information about the wayland-devel
mailing list