diff options
author | Rouven Czerwinski <rouven@czerwinskis.de> | 2020-09-15 09:31:02 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-09-15 09:55:30 +0200 |
commit | 299a159add1e842d10a0e641066f6f4718a75dcc (patch) | |
tree | 72bff908840a356d0b4392fc7a5557e9d6399f2f | |
parent | input/pointer: update cursor activity after updating button counts (diff) | |
download | sway-299a159add1e842d10a0e641066f6f4718a75dcc.tar.gz sway-299a159add1e842d10a0e641066f6f4718a75dcc.tar.zst sway-299a159add1e842d10a0e641066f6f4718a75dcc.zip |
cursor: arm cursor hide timer immediately
According to the wayland docs, wayland timers are disarmed on creation.
This leads to the cursor not being hidden if there is no activity after
creation, since the timer is armed on activity, but not at creation.
Arm the timer after creation to ensure the cursor is hidden even if
there is no cursor activity after creation.
Fixes #5684
-rw-r--r-- | sway/input/cursor.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index f5c2bd17..3e6b147e 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -1041,6 +1041,8 @@ struct sway_cursor *sway_cursor_create(struct sway_seat *seat) { | |||
1041 | 1041 | ||
1042 | cursor->hide_source = wl_event_loop_add_timer(server.wl_event_loop, | 1042 | cursor->hide_source = wl_event_loop_add_timer(server.wl_event_loop, |
1043 | hide_notify, cursor); | 1043 | hide_notify, cursor); |
1044 | wl_event_source_timer_update( | ||
1045 | cursor->hide_source, cursor_get_timeout(cursor)); | ||
1044 | 1046 | ||
1045 | wl_list_init(&cursor->image_surface_destroy.link); | 1047 | wl_list_init(&cursor->image_surface_destroy.link); |
1046 | cursor->image_surface_destroy.notify = handle_image_surface_destroy; | 1048 | cursor->image_surface_destroy.notify = handle_image_surface_destroy; |