summaryrefslogtreecommitdiff
path: root/ivi-input-modules/ivi-input-controller/src/ivi-input-controller.c
diff options
context:
space:
mode:
Diffstat (limited to 'ivi-input-modules/ivi-input-controller/src/ivi-input-controller.c')
-rw-r--r--ivi-input-modules/ivi-input-controller/src/ivi-input-controller.c38
1 files changed, 14 insertions, 24 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 257a1dc..826ee47 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
@@ -25,7 +25,7 @@
#include <string.h>
#include <weston.h>
-#include <weston/ivi-layout-export.h>
+#include <ivi-layout-export.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -917,18 +917,6 @@ destroy_seat(struct seat_ctx *ctx_seat)
{
struct ivisurface *surf;
struct wl_resource *resource;
- if (ctx_seat->keyboard_grab.keyboard) {
- keyboard_grab_cancel(&ctx_seat->keyboard_grab);
- weston_keyboard_end_grab(ctx_seat->keyboard_grab.keyboard);
- }
- if (ctx_seat->pointer_grab.pointer) {
- pointer_grab_cancel(&ctx_seat->pointer_grab);
- weston_pointer_end_grab(ctx_seat->pointer_grab.pointer);
- }
- if (ctx_seat->touch_grab.touch) {
- touch_grab_cancel(&ctx_seat->touch_grab);
- weston_touch_end_grab(ctx_seat->touch_grab.touch);
- }
/* Remove seat acceptance from surfaces which have input acceptance from
* this seat */
@@ -1071,17 +1059,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);
+ }
}
}
}