diff options
author | emersion <contact@emersion.fr> | 2017-11-12 22:11:17 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2017-11-12 22:11:17 +0100 |
commit | 2e312a7e27fac0ef299abbdf5f66cf164992f02f (patch) | |
tree | 6cd611b523474ba0adc423b0f84852fba01d9fe2 | |
parent | 28fc813ca9853147efc7915b829dd435699e9434 (diff) |
Fix hidden cursor when output is added before cursor
-rw-r--r-- | rootston/seat.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/rootston/seat.c b/rootston/seat.c index 8a838efe..3ec6f1b7 100644 --- a/rootston/seat.c +++ b/rootston/seat.c @@ -189,12 +189,11 @@ static void roots_seat_init_cursor(struct roots_seat *seat) { // TODO: be able to configure per-seat cursor themes seat->cursor->xcursor_manager = desktop->xcursor_manager; - wlr_xcursor_manager_set_cursor_image(seat->cursor->xcursor_manager, - ROOTS_XCURSOR_DEFAULT, wlr_cursor); wl_list_init(&seat->cursor->touch_points); roots_seat_configure_cursor(seat); + roots_seat_configure_xcursor(seat); // add input signals wl_signal_add(&wlr_cursor->events.motion, &seat->cursor->motion); @@ -448,6 +447,16 @@ void roots_seat_remove_device(struct roots_seat *seat, } void roots_seat_configure_xcursor(struct roots_seat *seat) { + struct roots_output *output; + wl_list_for_each(output, &seat->input->server->desktop->outputs, link) { + if (wlr_xcursor_manager_load(seat->cursor->xcursor_manager, + output->wlr_output->scale)) { + wlr_log(L_ERROR, "Cannot load xcursor theme for output '%s' " + "with scale %d", output->wlr_output->name, + output->wlr_output->scale); + } + } + wlr_xcursor_manager_set_cursor_image(seat->cursor->xcursor_manager, ROOTS_XCURSOR_DEFAULT, seat->cursor->cursor); wlr_cursor_warp(seat->cursor->cursor, NULL, seat->cursor->cursor->x, |