main: Increase access to per-client seats

transient-seats
Andri Yngvason 2023-03-25 10:30:31 +00:00
parent 1ef290d2d4
commit 75173ea838
1 changed files with 8 additions and 8 deletions

View File

@ -119,7 +119,7 @@ struct wayvnc_client {
struct wayvnc* server; struct wayvnc* server;
struct nvnc_client* nvnc_client; struct nvnc_client* nvnc_client;
struct wl_seat* seat; struct seat* seat;
struct ext_transient_seat_v1* transient_seat; struct ext_transient_seat_v1* transient_seat;
unsigned id; unsigned id;
@ -1130,10 +1130,10 @@ static void client_init_pointer(struct wayvnc_client* self)
self->pointer.pointer = pointer_manager_version >= 2 self->pointer.pointer = pointer_manager_version >= 2
? zwlr_virtual_pointer_manager_v1_create_virtual_pointer_with_output( ? zwlr_virtual_pointer_manager_v1_create_virtual_pointer_with_output(
wayvnc->pointer_manager, self->seat, wayvnc->pointer_manager, self->seat->wl_seat,
wayvnc->selected_output->wl_output) wayvnc->selected_output->wl_output)
: zwlr_virtual_pointer_manager_v1_create_virtual_pointer( : zwlr_virtual_pointer_manager_v1_create_virtual_pointer(
wayvnc->pointer_manager, self->seat); wayvnc->pointer_manager, self->seat->wl_seat);
if (pointer_init(&self->pointer) < 0) { if (pointer_init(&self->pointer) < 0) {
nvnc_log(NVNC_LOG_ERROR, "Failed to initialise pointer"); nvnc_log(NVNC_LOG_ERROR, "Failed to initialise pointer");
@ -1152,7 +1152,7 @@ static void handle_transient_seat_ready(void* data,
struct seat* seat = seat_find_by_id(&wayvnc->seats, global_name); struct seat* seat = seat_find_by_id(&wayvnc->seats, global_name);
assert(seat); assert(seat);
client->seat = seat->wl_seat; client->seat = seat;
} }
static void handle_transient_seat_denied(void* data, static void handle_transient_seat_denied(void* data,
@ -1166,7 +1166,7 @@ static void handle_transient_seat_denied(void* data,
// TODO: Should this perhaps be fatal? // TODO: Should this perhaps be fatal?
nvnc_log(NVNC_LOG_WARNING, "Transient seat denied"); nvnc_log(NVNC_LOG_WARNING, "Transient seat denied");
client->seat = wayvnc->selected_seat->wl_seat; client->seat = wayvnc->selected_seat;
} }
static void client_init_seat(struct wayvnc_client* self) static void client_init_seat(struct wayvnc_client* self)
@ -1193,7 +1193,7 @@ static void client_init_seat(struct wayvnc_client* self)
assert(self->seat); assert(self->seat);
} else { } else {
self->seat = wayvnc->selected_seat->wl_seat; self->seat = wayvnc->selected_seat;
} }
} }
@ -1206,7 +1206,7 @@ static void client_init_keyboard(struct wayvnc_client* self)
self->keyboard.virtual_keyboard = self->keyboard.virtual_keyboard =
zwp_virtual_keyboard_manager_v1_create_virtual_keyboard( zwp_virtual_keyboard_manager_v1_create_virtual_keyboard(
wayvnc->keyboard_manager, self->seat); wayvnc->keyboard_manager, self->seat->wl_seat);
struct xkb_rule_names rule_names = { struct xkb_rule_names rule_names = {
.rules = wayvnc->cfg.xkb_rules, .rules = wayvnc->cfg.xkb_rules,
@ -1242,7 +1242,7 @@ static void client_init_data_control(struct wayvnc_client* self)
self->data_control.manager = wayvnc->data_control_manager; self->data_control.manager = wayvnc->data_control_manager;
data_control_init(&self->data_control, wayvnc->display, wayvnc->nvnc, data_control_init(&self->data_control, wayvnc->display, wayvnc->nvnc,
self->seat); self->seat->wl_seat);
} }
void log_selected_output(struct wayvnc* self) void log_selected_output(struct wayvnc* self)