kiosk-shell: Remove keyboard_focus and seat_caps listeners

The seat_cap listener was to register a signal for keyboard_focus, which
we no longer use. Remove it entirely to avoid dead code.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Derek Foreman <derek.foreman@collabora.com>
dev
Marius Vlad 3 years ago
parent f886311353
commit 4b23aa11ae
  1. 37
      kiosk-shell/kiosk-shell.c
  2. 3
      kiosk-shell/kiosk-shell.h

@ -396,19 +396,10 @@ kiosk_shell_surface_activate(struct kiosk_shell_surface *shsurf,
* kiosk_shell_seat * kiosk_shell_seat
*/ */
static void
kiosk_shell_seat_handle_keyboard_focus(struct wl_listener *listener, void *data)
{
/* FIXME: To be removed later. */
}
static void static void
kiosk_shell_seat_destroy(struct kiosk_shell_seat *shseat) kiosk_shell_seat_destroy(struct kiosk_shell_seat *shseat)
{ {
wl_list_remove(&shseat->keyboard_focus_listener.link);
wl_list_remove(&shseat->caps_changed_listener.link);
wl_list_remove(&shseat->seat_destroy_listener.link); wl_list_remove(&shseat->seat_destroy_listener.link);
wl_list_remove(&shseat->link); wl_list_remove(&shseat->link);
free(shseat); free(shseat);
} }
@ -423,26 +414,6 @@ kiosk_shell_seat_handle_destroy(struct wl_listener *listener, void *data)
kiosk_shell_seat_destroy(shseat); kiosk_shell_seat_destroy(shseat);
} }
static void
kiosk_shell_seat_handle_caps_changed(struct wl_listener *listener, void *data)
{
struct weston_keyboard *keyboard;
struct kiosk_shell_seat *shseat;
shseat = container_of(listener, struct kiosk_shell_seat,
caps_changed_listener);
keyboard = weston_seat_get_keyboard(shseat->seat);
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 kiosk_shell_seat * static struct kiosk_shell_seat *
kiosk_shell_seat_create(struct kiosk_shell *shell, struct weston_seat *seat) kiosk_shell_seat_create(struct kiosk_shell *shell, struct weston_seat *seat)
{ {
@ -465,14 +436,6 @@ kiosk_shell_seat_create(struct kiosk_shell *shell, struct weston_seat *seat)
shseat->seat_destroy_listener.notify = kiosk_shell_seat_handle_destroy; shseat->seat_destroy_listener.notify = kiosk_shell_seat_handle_destroy;
wl_signal_add(&seat->destroy_signal, &shseat->seat_destroy_listener); wl_signal_add(&seat->destroy_signal, &shseat->seat_destroy_listener);
shseat->keyboard_focus_listener.notify = kiosk_shell_seat_handle_keyboard_focus;
wl_list_init(&shseat->keyboard_focus_listener.link);
shseat->caps_changed_listener.notify = kiosk_shell_seat_handle_caps_changed;
wl_signal_add(&seat->updated_caps_signal,
&shseat->caps_changed_listener);
kiosk_shell_seat_handle_caps_changed(&shseat->caps_changed_listener, NULL);
wl_list_insert(&shell->seat_list, &shseat->link); wl_list_insert(&shell->seat_list, &shseat->link);
return shseat; return shseat;

@ -79,9 +79,6 @@ struct kiosk_shell_seat {
struct wl_listener seat_destroy_listener; struct wl_listener seat_destroy_listener;
struct weston_surface *focused_surface; struct weston_surface *focused_surface;
struct wl_listener caps_changed_listener;
struct wl_listener keyboard_focus_listener;
struct wl_list link; /** kiosk_shell::seat_list */ struct wl_list link; /** kiosk_shell::seat_list */
}; };

Loading…
Cancel
Save