From 23e741144289a313079309a24c1516a5504a5c63 Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Sat, 30 Sep 2017 08:46:18 -0400 Subject: rootston: create desktop before input --- rootston/desktop.c | 5 ----- rootston/input.c | 7 +++++++ rootston/main.c | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/rootston/desktop.c b/rootston/desktop.c index cd417755..14703e6e 100644 --- a/rootston/desktop.c +++ b/rootston/desktop.c @@ -78,11 +78,6 @@ struct roots_desktop *desktop_create(struct roots_server *server, desktop->compositor = wlr_compositor_create( server->wl_display, server->renderer); - wlr_cursor_attach_output_layout(server->input->cursor, desktop->layout); - wlr_cursor_map_to_region(server->input->cursor, config->cursor.mapped_box); - cursor_load_config(config, server->input->cursor, - server->input, desktop); - desktop->xdg_shell_v6 = wlr_xdg_shell_v6_create(server->wl_display); wl_signal_add(&desktop->xdg_shell_v6->events.new_surface, &desktop->xdg_shell_v6_surface); diff --git a/rootston/input.c b/rootston/input.c index b4427212..9157ecc7 100644 --- a/rootston/input.c +++ b/rootston/input.c @@ -71,6 +71,8 @@ static void input_remove_notify(struct wl_listener *listener, void *data) { struct roots_input *input_create(struct roots_server *server, struct roots_config *config) { wlr_log(L_DEBUG, "Initializing roots input"); + assert(server->desktop); + struct roots_input *input = calloc(1, sizeof(struct roots_input)); assert(input); @@ -104,6 +106,11 @@ struct roots_input *input_create(struct roots_server *server, cursor_initialize(input); wlr_cursor_set_xcursor(input->cursor, input->xcursor); + wlr_cursor_attach_output_layout(input->cursor, server->desktop->layout); + wlr_cursor_map_to_region(input->cursor, config->cursor.mapped_box); + cursor_load_config(config, input->cursor, + input, server->desktop); + return input; } diff --git a/rootston/main.c b/rootston/main.c index c8ec1249..7b1ca298 100644 --- a/rootston/main.c +++ b/rootston/main.c @@ -20,8 +20,8 @@ int main(int argc, char **argv) { assert(server.renderer = wlr_gles2_renderer_create(server.backend)); wl_display_init_shm(server.wl_display); - server.input = input_create(&server, server.config); server.desktop = desktop_create(&server, server.config); + server.input = input_create(&server, server.config); server.data_device_manager = wlr_data_device_manager_create( server.wl_display); -- cgit v1.2.3