Only allow focused client to change cursor surface
@@ -9,10 +9,13 @@ static void wc_seat_request_cursor(struct wl_listener* listener, void* data) {
struct wc_server* server = wl_container_of(listener, server,
request_set_cursor);
struct wlr_seat_pointer_request_set_cursor_event* event = data;
- // TODO Check that the client is the same as the focused client
+ struct wlr_seat_client *focused_client =
+ server->seat->pointer_state.focused_client;
+ if (focused_client == event->seat_client) {
wlr_cursor_set_surface(server->cursor->wlr_cursor,
event->surface, event->hotspot_x, event->hotspot_y);
}
+}
void init_seat(struct wc_server* server) {
server->seat = wlr_seat_create(server->wl_display, "seat0");
