[PATCH weston 2/3] text: Don't track binding in struct text_backend
Derek Foreman
derekf at osg.samsung.com
Wed Sep 23 08:27:42 PDT 2015
On 17/09/15 03:45 PM, Bryce Harrington wrote:
> On Thu, Jun 25, 2015 at 03:49:48PM -0500, Derek Foreman wrote:
>> The binding is only used for preventing launch, and we've already got the
>> pid for that.
>>
>> With multiple seats there are multiple bindings, so if the most recent
>> binding unbinds it will clear the pointer, so using it like this is risky
>> anyway.
>
> Ok, if I understand it, you're saying that basically checking for
> text_backend->input_method.binding in launch_input_method() is redundant
> text_backend->with:
>
> if (text_backend->input_method.process.pid != 0)
> return;
>
> And since nothing else here needs text_backend->input_method.binding we
> can just drop it entirely.
Right.
> Seems reasonable and sensible to me. Just in case, would like to wait
> on landing until after the release.
Seems prudent. :)
> Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
>
>> Signed-off-by: Derek Foreman <derekf at osg.samsung.com>
>> ---
>> src/text-backend.c | 9 ---------
>> 1 file changed, 9 deletions(-)
>>
>> diff --git a/src/text-backend.c b/src/text-backend.c
>> index 397c51b..59011c8 100644
>> --- a/src/text-backend.c
>> +++ b/src/text-backend.c
>> @@ -100,7 +100,6 @@ struct text_backend {
>>
>> struct {
>> char *path;
>> - struct wl_resource *binding;
>> struct weston_process process;
>> struct wl_client *client;
>>
>> @@ -830,12 +829,9 @@ static void
>> unbind_input_method(struct wl_resource *resource)
>> {
>> struct input_method *input_method = wl_resource_get_user_data(resource);
>> - struct text_backend *text_backend = input_method->text_backend;
>>
>> input_method->input_method_binding = NULL;
>> input_method->context = NULL;
>> -
>> - text_backend->input_method.binding = NULL;
>> }
>>
>> static void
>> @@ -869,8 +865,6 @@ bind_input_method(struct wl_client *client,
>> wl_resource_set_implementation(resource, NULL, input_method,
>> unbind_input_method);
>> input_method->input_method_binding = resource;
>> -
>> - text_backend->input_method.binding = resource;
>> }
>>
>> static void
>> @@ -954,9 +948,6 @@ handle_input_method_sigchld(struct weston_process *process, int status)
>> static void
>> launch_input_method(struct text_backend *text_backend)
>> {
>> - if (text_backend->input_method.binding)
>> - return;
>> -
>> if (!text_backend->input_method.path)
>> return;
>>
>> --
>> 2.1.4
>>
>> _______________________________________________
>> wayland-devel mailing list
>> wayland-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list