diff options
author | Jeka Friedrich <friedrix@gmail.com> | 2022-02-06 22:54:31 +0100 |
---|---|---|
committer | Jeka Friedrich <friedrix@gmail.com> | 2022-02-06 22:54:31 +0100 |
commit | f524e296131c87a8e69afe5eba14a379f1715b7c (patch) | |
tree | caa2549e92c285a44ae683250aae0bb266b901e9 | |
parent | 8d4c227ca0a1f836a769a051732a826abbf5d98a (diff) | |
parent | b1e5973764cc42aee113fcf82249d7dd74de4131 (diff) | |
download | wayland-ivi-extension-f524e296131c87a8e69afe5eba14a379f1715b7c.tar.gz |
Merge remote-tracking branch 'upstream/pull/121'
* upstream/pull/121
Fix NULL pointer exception in case of no input device
Reviewed-by: Eugen Friedrich <efriedrich@de.adit-jv.com>
-rw-r--r-- | ivi-input-modules/ivi-input-controller/src/ivi-input-controller.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/ivi-input-modules/ivi-input-controller/src/ivi-input-controller.c b/ivi-input-modules/ivi-input-controller/src/ivi-input-controller.c index a0bfc48..e5f2e1d 100644 --- a/ivi-input-modules/ivi-input-controller/src/ivi-input-controller.c +++ b/ivi-input-modules/ivi-input-controller/src/ivi-input-controller.c @@ -1071,17 +1071,19 @@ setup_input_focus(struct input_context *ctx, uint32_t surface, if (NULL != surf) { wl_list_for_each(st_focus, &surf->accepted_seat_list, link) { ctx_seat = st_focus->seat_ctx; - if (device & ILM_INPUT_DEVICE_POINTER) { - input_ctrl_ptr_set_focus_surf(ctx_seat, surf, enabled); - } - if (device & ILM_INPUT_DEVICE_KEYBOARD) { - input_ctrl_kbd_set_focus_surf(ctx_seat, surf, enabled); - } - if (device & ILM_INPUT_DEVICE_TOUCH) { - /*Touch focus cannot be forced to a particular surface. - * Preserve the old behaviour by sending it to controller. - * TODO: Should we just remove focus setting for touch?*/ - send_input_focus(ctx, surf, device, enabled); + if (ctx_seat != NULL) { + if (device & ILM_INPUT_DEVICE_POINTER) { + input_ctrl_ptr_set_focus_surf(ctx_seat, surf, enabled); + } + if (device & ILM_INPUT_DEVICE_KEYBOARD) { + input_ctrl_kbd_set_focus_surf(ctx_seat, surf, enabled); + } + if (device & ILM_INPUT_DEVICE_TOUCH) { + /*Touch focus cannot be forced to a particular surface. + * Preserve the old behaviour by sending it to controller. + * TODO: Should we just remove focus setting for touch?*/ + send_input_focus(ctx, surf, device, enabled); + } } } } |