labwc.h: remove "extern struct server server"

This commit is contained in:
Johan Malm 2020-09-08 20:18:12 +01:00
parent 84ebd2dae5
commit e99d0bb34e
11 changed files with 62 additions and 47 deletions

View file

@ -1,11 +1,23 @@
#include "labwc.h"
static struct wlr_seat *current_seat;
void seat_init(struct wlr_seat *seat)
{
current_seat = seat;
}
void seat_focus_surface(struct wlr_surface *surface)
{
if (!surface) {
wlr_seat_keyboard_notify_clear_focus(server.seat);
wlr_seat_keyboard_notify_clear_focus(current_seat);
return;
}
/* TODO: add keyboard stuff */
wlr_seat_keyboard_notify_enter(server.seat, surface, NULL, 0, NULL);
wlr_seat_keyboard_notify_enter(current_seat, surface, NULL, 0, NULL);
}
struct wlr_surface *seat_focused_surface(void)
{
return current_seat->keyboard_state.focused_surface;
}