[PATCH weston] text-input: Clear out context->input pointer

Pekka Paalanen ppaalanen at gmail.com
Fri Nov 18 13:45:55 UTC 2016


On Thu, 10 Nov 2016 15:47:56 +0000
Daniel Stone <daniels at collabora.com> wrote:

> If we destroy the text_input (e.g. due to surface deactivation) whilst
> the IM manager (the client holding the input_method_context resource,
> usually weston-keyboard) sends an event, we can hit a segfault in
> text-backend. This is because we free the text_input structure, but
> don't actually clear the context->input structure even when we send the
> deactivate event.
> 
> This is clearly intended to be catered for, since context->input is
> always checked for NULL before we relay any events.
> 
> This is enough to fix one cause of text-test failing, but it's
> ultimately error-prone until we have a no-op test-shell; there is still
> a race where weston-desktop-shell can launch weston-keyboard before
> text-test manages to bind zwp_text_input_manager.
> 
> Signed-off-by: Daniel Stone <daniels at collabora.com>
> Maniphest Tasks: https://phabricator.freedesktop.org/T7615
> ---
>  compositor/text-backend.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/compositor/text-backend.c b/compositor/text-backend.c
> index 262ba9f..bf5c45c 100644
> --- a/compositor/text-backend.c
> +++ b/compositor/text-backend.c
> @@ -132,6 +132,7 @@ deactivate_input_method(struct input_method *input_method)
>  		zwp_input_method_v1_send_deactivate(
>  			input_method->input_method_binding,
>  			input_method->context->resource);
> +		input_method->context->input = NULL;
>  	}
>  
>  	wl_list_remove(&input_method->link);

Pushed:
   e7fff21..97863d6  master -> master


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


More information about the wayland-devel mailing list