X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Finput.c;h=1a143ce0d6d6aed4024f35388b92897a5f94f64c;hb=bb79d12c92fa6e860319c4c730d4c5c9e23932a2;hp=6f8b7cb819950fa0f0fb29b2caad933c165e9260;hpb=2844fde1df83707f3e32ed4ead54b46a476e551d;p=src%2Fagl-compositor.git diff --git a/src/input.c b/src/input.c index 6f8b7cb..1a143ce 100644 --- a/src/input.c +++ b/src/input.c @@ -32,20 +32,7 @@ #include "ivi-compositor.h" #include "shared/helpers.h" -struct ivi_shell_seat { - struct weston_seat *seat; - struct weston_surface *focused_surface; - - bool hide_cursor; - bool new_caps_sent; - - struct wl_listener seat_destroy_listener; - struct wl_listener caps_changed_listener; - struct wl_listener keyboard_focus_listener; - struct wl_listener pointer_focus_listener; -}; - -static struct ivi_surface * +struct ivi_surface * get_ivi_shell_surface(struct weston_surface *surface) { struct weston_desktop_surface *desktop_surface = @@ -72,19 +59,37 @@ ivi_shell_seat_handle_destroy(struct wl_listener *listener, void *data) free(shseat); } -static struct ivi_shell_seat * +struct ivi_shell_seat * get_ivi_shell_seat(struct weston_seat *seat) { struct wl_listener *listener; + if (!seat) + return NULL; + + listener = wl_signal_get(&seat->destroy_signal, ivi_shell_seat_handle_destroy); - assert(listener != NULL); + if (!listener) + return NULL; return container_of(listener, struct ivi_shell_seat, seat_destroy_listener); } +struct weston_seat * +get_ivi_shell_weston_first_seat(struct ivi_compositor *ivi) +{ + struct wl_list *node; + struct weston_compositor *compositor = ivi->compositor; + + if (wl_list_empty(&compositor->seat_list)) + return NULL; + + node = compositor->seat_list.next; + return container_of(node, struct weston_seat, link); +} + static void ivi_shell_seat_handle_pointer_focus(struct wl_listener *listener, void *data) {