From 21a8539399d0122d4857597e9e959b83efc1cd51 Mon Sep 17 00:00:00 2001 From: Jente Hidskes Date: Wed, 8 Jul 2020 21:57:59 +0200 Subject: [PATCH] seat: add cage_seat_get_focus function --- input/seat.c | 8 ++++++++ input/seat.h | 1 + 2 files changed, 9 insertions(+) diff --git a/input/seat.c b/input/seat.c index 02a6875..d478ec5 100644 --- a/input/seat.c +++ b/input/seat.c @@ -18,6 +18,14 @@ #include "pointer.h" #include "seat.h" +struct wlr_surface * +cage_seat_get_focus(struct cg_seat *seat) +{ + assert(seat != NULL); + + return seat->wlr_seat->keyboard_state.focused_surface; +} + void cage_seat_add_new_keyboard(struct cg_seat *seat, struct wlr_input_device *device) { diff --git a/input/seat.h b/input/seat.h index c63d3e7..f1884f8 100644 --- a/input/seat.h +++ b/input/seat.h @@ -17,6 +17,7 @@ struct cg_seat { struct wl_list keyboard_groups; // cg_keyboard_group::link }; +struct wlr_surface *cage_seat_get_focus(struct cg_seat *seat); void cage_seat_add_new_keyboard(struct cg_seat *seat, struct wlr_input_device *device); void cage_seat_add_new_pointer(struct cg_seat *seat, struct wlr_input_device *device); void cage_seat_update_capabilities(struct cg_seat *seat);