diff options
author | Emre Ucan <eucan@de.adit-jv.com> | 2015-05-18 09:36:32 +0200 |
---|---|---|
committer | Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp> | 2015-06-15 16:23:31 +0900 |
commit | c8ad4b1467031e503b0abdf8e88f8b3c44c7b158 (patch) | |
tree | a73756bd127e1185de3446680db08f7fb24fef2c /ivi-input-api | |
parent | e8914865a210f007f3c917098f2da7b7c7258a09 (diff) | |
download | wayland-ivi-extension-c8ad4b1467031e503b0abdf8e88f8b3c44c7b158.tar.gz |
ilmInput: control seat exists by ilm_setInputAcceptanceOn
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Diffstat (limited to 'ivi-input-api')
-rw-r--r-- | ivi-input-api/ilmInput/src/ilm_input.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/ivi-input-api/ilmInput/src/ilm_input.c b/ivi-input-api/ilmInput/src/ilm_input.c index 511eab9..9e4795b 100644 --- a/ivi-input-api/ilmInput/src/ilm_input.c +++ b/ivi-input-api/ilmInput/src/ilm_input.c @@ -42,7 +42,9 @@ ilm_setInputAcceptanceOn(t_ilm_surface surfaceID, t_ilm_uint num_seats, int i; struct surface_context *surface_ctx = NULL; struct accepted_seat *accepted_seat; + struct seat_context *seat; int surface_found = 0; + int seat_found = 0; if ((seats == NULL) && (num_seats != 0)) { fprintf(stderr, "Invalid Argument\n"); @@ -63,17 +65,33 @@ ilm_setInputAcceptanceOn(t_ilm_surface surfaceID, t_ilm_uint num_seats, release_instance(); return ILM_FAILED; } + + for(i = 0; i < num_seats; i++) { + wl_list_for_each(seat, &ctx->wl.list_seat, link) { + if (strcmp(seat->seat_name, seats[i]) == 0) + seat_found = 1; + } + + if (!seat_found) { + fprintf(stderr, "seat: %s not found\n", seats[i]); + release_instance(); + return ILM_FAILED; + } + + seat_found = 0; + } /* Send events to add input acceptance for every seat in 'seats', but * not on the surface's list */ for(i = 0; i < num_seats; i++) { - int seat_found = 0; + int has_seat = 0; wl_list_for_each(accepted_seat, &surface_ctx->list_accepted_seats, link) { if (strcmp(accepted_seat->seat_name, seats[i]) == 0) - seat_found = 1; + has_seat = 1; } - if (!seat_found) { + + if (!has_seat) { ivi_input_set_input_acceptance(ctx->wl.input_controller, surfaceID, seats[i], ILM_TRUE); @@ -83,12 +101,12 @@ ilm_setInputAcceptanceOn(t_ilm_surface surfaceID, t_ilm_uint num_seats, /* Send events to remove input acceptance for every seat on the surface's * list but not in 'seats' */ wl_list_for_each(accepted_seat, &surface_ctx->list_accepted_seats, link) { - int seat_found = 0; + int has_seat = 0; for (i = 0; i < num_seats; i++) { if (strcmp(accepted_seat->seat_name, seats[i]) == 0) - seat_found = 1; + has_seat = 1; } - if (!seat_found) + if (!has_seat) ivi_input_set_input_acceptance(ctx->wl.input_controller, surfaceID, accepted_seat->seat_name, |