2020-09-04 20:25:20 +01:00
|
|
|
#include "labwc.h"
|
|
|
|
|
|
2020-09-08 20:18:12 +01:00
|
|
|
static struct wlr_seat *current_seat;
|
|
|
|
|
|
2020-09-28 20:41:41 +01:00
|
|
|
void
|
|
|
|
|
seat_init(struct wlr_seat *seat)
|
2020-09-08 20:18:12 +01:00
|
|
|
{
|
|
|
|
|
current_seat = seat;
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-28 20:41:41 +01:00
|
|
|
void
|
|
|
|
|
seat_focus_surface(struct wlr_surface *surface)
|
2020-09-04 20:25:20 +01:00
|
|
|
{
|
|
|
|
|
if (!surface) {
|
2020-09-08 20:18:12 +01:00
|
|
|
wlr_seat_keyboard_notify_clear_focus(current_seat);
|
2020-09-04 20:25:20 +01:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
/* TODO: add keyboard stuff */
|
2020-09-08 20:18:12 +01:00
|
|
|
wlr_seat_keyboard_notify_enter(current_seat, surface, NULL, 0, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-28 20:41:41 +01:00
|
|
|
struct wlr_surface *
|
|
|
|
|
seat_focused_surface(void)
|
2020-09-08 20:18:12 +01:00
|
|
|
{
|
|
|
|
|
return current_seat->keyboard_state.focused_surface;
|
2020-09-04 20:25:20 +01:00
|
|
|
}
|