cursor: update hide timer during config apply

We can't arm the timer during cursor creation since the config may not
be ready yet. Instead arm the timer while applying the input
configuration, by this time the configuration has been parsed and we can
arm the hide timer.

Fixes #5686
This commit is contained in:
Rouven Czerwinski 2020-09-15 17:48:21 +02:00 committed by Simon Ser
parent 65a751a21f
commit 41999d7c9f
2 changed files with 2 additions and 2 deletions

View File

@ -1041,8 +1041,6 @@ struct sway_cursor *sway_cursor_create(struct sway_seat *seat) {
cursor->hide_source = wl_event_loop_add_timer(server.wl_event_loop, cursor->hide_source = wl_event_loop_add_timer(server.wl_event_loop,
hide_notify, cursor); hide_notify, cursor);
wl_event_source_timer_update(
cursor->hide_source, cursor_get_timeout(cursor));
wl_list_init(&cursor->image_surface_destroy.link); wl_list_init(&cursor->image_surface_destroy.link);
cursor->image_surface_destroy.notify = handle_image_surface_destroy; cursor->image_surface_destroy.notify = handle_image_surface_destroy;

View File

@ -722,6 +722,8 @@ static void seat_configure_pointer(struct sway_seat *seat,
wlr_cursor_attach_input_device(seat->cursor->cursor, wlr_cursor_attach_input_device(seat->cursor->cursor,
sway_device->input_device->wlr_device); sway_device->input_device->wlr_device);
seat_apply_input_config(seat, sway_device); seat_apply_input_config(seat, sway_device);
wl_event_source_timer_update(
seat->cursor->hide_source, cursor_get_timeout(seat->cursor));
} }
static void seat_configure_keyboard(struct sway_seat *seat, static void seat_configure_keyboard(struct sway_seat *seat,