input: Remove keyboard listener keyboard focus activation 90/27590/2
authorMarius Vlad <marius.vlad@collabora.com>
Sat, 19 Feb 2022 19:45:59 +0000 (21:45 +0200)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Fri, 10 Jun 2022 21:20:46 +0000 (21:20 +0000)
This is part of the bigger series to remove the need to have a keyboard
present to activate views/surfaces. This clean-ups any keyboard
listener we had installed previously.

Bug-AGL: SPEC-4413

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: Iacd63a857cfe4d17c665f37dc8338cd790b7d16f

src/input.c

index 64d23ef..6f8b7cb 100644 (file)
@@ -85,30 +85,6 @@ get_ivi_shell_seat(struct weston_seat *seat)
                            struct ivi_shell_seat, seat_destroy_listener);
 }
 
-
-static void
-ivi_shell_seat_handle_keyboard_focus(struct wl_listener *listener, void *data)
-{
-       struct weston_keyboard *keyboard = data;
-       struct ivi_shell_seat *shseat = get_ivi_shell_seat(keyboard->seat);
-
-       if (shseat->focused_surface) {
-               struct ivi_surface *surf =
-                       get_ivi_shell_surface(shseat->focused_surface);
-               if (surf && --surf->focus_count == 0)
-                       weston_desktop_surface_set_activated(surf->dsurface, false);
-       }
-
-       shseat->focused_surface = weston_surface_get_main_surface(keyboard->focus);
-
-       if (shseat->focused_surface) {
-               struct ivi_surface *surf =
-                       get_ivi_shell_surface(shseat->focused_surface);
-               if (surf && surf->focus_count++ == 0)
-                       weston_desktop_surface_set_activated(surf->dsurface, true);
-       }
-}
-
 static void
 ivi_shell_seat_handle_pointer_focus(struct wl_listener *listener, void *data)
 {
@@ -139,13 +115,11 @@ ivi_shell_seat_handle_pointer_focus(struct wl_listener *listener, void *data)
 static void
 ivi_shell_seat_handle_caps_changed(struct wl_listener *listener, void *data)
 {
-       struct weston_keyboard *keyboard;
        struct weston_pointer *pointer;
        struct ivi_shell_seat *shseat;
 
        shseat = container_of(listener, struct ivi_shell_seat,
                              caps_changed_listener);
-       keyboard = weston_seat_get_keyboard(shseat->seat);
        pointer = weston_seat_get_pointer(shseat->seat);
 
        if (pointer && wl_list_empty(&shseat->pointer_focus_listener.link)) {
@@ -155,15 +129,6 @@ ivi_shell_seat_handle_caps_changed(struct wl_listener *listener, void *data)
                wl_list_remove(&shseat->pointer_focus_listener.link);
                wl_list_init(&shseat->pointer_focus_listener.link);
        }
-
-       if (keyboard &&
-           wl_list_empty(&shseat->keyboard_focus_listener.link)) {
-               wl_signal_add(&keyboard->focus_signal,
-                             &shseat->keyboard_focus_listener);
-       } else if (!keyboard) {
-               wl_list_remove(&shseat->keyboard_focus_listener.link);
-               wl_list_init(&shseat->keyboard_focus_listener.link);
-       }
 }
 
 static struct ivi_shell_seat *
@@ -184,8 +149,6 @@ ivi_shell_seat_create(struct weston_seat *seat, bool hide_cursor)
        shseat->seat_destroy_listener.notify = ivi_shell_seat_handle_destroy;
        wl_signal_add(&seat->destroy_signal, &shseat->seat_destroy_listener);
 
-       shseat->keyboard_focus_listener.notify =
-               ivi_shell_seat_handle_keyboard_focus;
        wl_list_init(&shseat->keyboard_focus_listener.link);
 
        shseat->pointer_focus_listener.notify =