blob: f90935c763558a9361d5c35a527717ffe9122f02 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#include "state.h"
#include "wayland.h"
struct wl_seat_listener seat_listener;
void setup_seat(client_state* state) {
wl_seat_add_listener(state->seat, &seat_listener, state);
}
// listeners
void capabilities(void *data, struct wl_seat *wl_seat, uint32_t capabilities) {
client_state* state = data;
if (capabilities & WL_SEAT_CAPABILITY_KEYBOARD && !state->keyboard) {
setup_keyboard(state);
}
if (capabilities & WL_SEAT_CAPABILITY_POINTER && !state->pointer) {
setup_pointer(state);
}
}
void name(void *data, struct wl_seat *wl_seat, const char *name) {
}
struct wl_seat_listener seat_listener = {
.capabilities = capabilities,
.name = name,
};
|