diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-09-30 09:08:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-30 09:08:35 -0400 |
commit | edf5e6211d07d7b8f35e8dabd4d97303743e3c7c (patch) | |
tree | fb8b62372425a118cbe9e1ea5b1a3ac51481bc37 | |
parent | 0c48ef5ad860dfdd041b9ce5d300c6fa85151e3f (diff) | |
parent | 23e741144289a313079309a24c1516a5504a5c63 (diff) |
Merge pull request #176 from acrisci/bug/init-desktop-before-input
rootston: create desktop before input
-rw-r--r-- | rootston/desktop.c | 5 | ||||
-rw-r--r-- | rootston/input.c | 7 | ||||
-rw-r--r-- | 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); |