From ec5beeb8b8eec615f74f640f84e8fa8e451ba3bb Mon Sep 17 00:00:00 2001 From: emersion Date: Fri, 27 Oct 2017 19:09:38 +0200 Subject: Move xcursor stuff into its own file --- rootston/input.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'rootston/input.c') diff --git a/rootston/input.c b/rootston/input.c index f424485e..a6792bdb 100644 --- a/rootston/input.c +++ b/rootston/input.c @@ -81,16 +81,17 @@ struct roots_input *input_create(struct roots_server *server, input->config = config; input->server = server; - input->theme = wlr_xcursor_theme_load("default", 16); - if (input->theme == NULL) { + input->xcursor_theme = wlr_xcursor_theme_load("default", 16); + if (input->xcursor_theme == NULL) { wlr_log(L_ERROR, "Cannot load xcursor theme"); free(input); return NULL; } - input->xcursor = wlr_xcursor_theme_get_cursor(input->theme, "left_ptr"); - if (input->xcursor == NULL) { + + struct wlr_xcursor *xcursor = get_default_xcursor(input->xcursor_theme); + if (xcursor == NULL) { wlr_log(L_ERROR, "Cannot load xcursor from theme"); - wlr_xcursor_theme_destroy(input->theme); + wlr_xcursor_theme_destroy(input->xcursor_theme); free(input); return NULL; } @@ -98,7 +99,7 @@ struct roots_input *input_create(struct roots_server *server, input->wl_seat = wlr_seat_create(server->wl_display, "seat0"); if (input->wl_seat == NULL) { wlr_log(L_ERROR, "Cannot create seat"); - wlr_xcursor_theme_destroy(input->theme); + wlr_xcursor_theme_destroy(input->xcursor_theme); free(input); return NULL; } @@ -117,7 +118,7 @@ struct roots_input *input_create(struct roots_server *server, input->cursor = wlr_cursor_create(); cursor_initialize(input); - wlr_cursor_set_xcursor(input->cursor, input->xcursor); + wlr_cursor_set_xcursor(input->cursor, xcursor); wlr_cursor_attach_output_layout(input->cursor, server->desktop->layout); wlr_cursor_map_to_region(input->cursor, config->cursor.mapped_box); -- cgit v1.2.3