diff options
Diffstat (limited to 'rootston')
-rw-r--r-- | rootston/input.c | 3 | ||||
-rw-r--r-- | rootston/main.c | 19 |
2 files changed, 15 insertions, 7 deletions
diff --git a/rootston/input.c b/rootston/input.c index ce20e840..94524b5f 100644 --- a/rootston/input.c +++ b/rootston/input.c @@ -27,7 +27,7 @@ static const char *device_type(enum wlr_input_device_type type) { return NULL; } -static struct roots_seat *input_get_seat(struct roots_input *input, char *name) { +struct roots_seat *input_get_seat(struct roots_input *input, char *name) { struct roots_seat *seat = NULL; wl_list_for_each(seat, &input->seats, link) { if (strcmp(seat->seat->name, name) == 0) { @@ -86,6 +86,7 @@ struct roots_input *input_create(struct roots_server *server, input->server = server; wl_list_init(&input->seats); + roots_seat_create(input, ROOTS_CONFIG_DEFAULT_SEAT_NAME); input->input_add.notify = input_add_notify; wl_signal_add(&server->backend->events.input_add, &input->input_add); diff --git a/rootston/main.c b/rootston/main.c index 74f9195c..38bbec53 100644 --- a/rootston/main.c +++ b/rootston/main.c @@ -13,6 +13,19 @@ struct roots_server server = { 0 }; static void ready(struct wl_listener *listener, void *data) { + struct roots_desktop *desktop = + wl_container_of(listener, desktop, xwayland_ready); + +#ifdef HAS_XWAYLAND + struct wlr_xwayland *xwayland = data; + if (xwayland) { + struct roots_seat *seat = + input_get_seat(desktop->server->input, + ROOTS_CONFIG_DEFAULT_SEAT_NAME); + wlr_xwayland_set_seat(xwayland, seat->seat); + } +#endif + if (server.config->startup_cmd != NULL) { const char *cmd = server.config->startup_cmd; pid_t pid = fork(); @@ -38,12 +51,6 @@ int main(int argc, char **argv) { server.desktop = desktop_create(&server, server.config); server.input = input_create(&server, server.config); - struct roots_seat *default_seat = - roots_seat_create(server.input, ROOTS_CONFIG_DEFAULT_SEAT_NAME); - if (server.desktop->xwayland) { - server.desktop->xwayland->seat = default_seat->seat; - } - const char *socket = wl_display_add_socket_auto(server.wl_display); if (!socket) { wlr_log_errno(L_ERROR, "Unable to open wayland socket"); |