diff options
-rw-r--r-- | sway/input/cursor.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 26e60cde..5739aafb 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -186,7 +186,12 @@ static int hide_notify(void *data) { | |||
186 | return 1; | 186 | return 1; |
187 | } | 187 | } |
188 | 188 | ||
189 | int cursor_get_timeout(struct sway_cursor *cursor){ | 189 | int cursor_get_timeout(struct sway_cursor *cursor) { |
190 | if (cursor->pressed_button_count > 0) { | ||
191 | // Do not hide cursor unless all buttons are released | ||
192 | return 0; | ||
193 | } | ||
194 | |||
190 | struct seat_config *sc = seat_get_config(cursor->seat); | 195 | struct seat_config *sc = seat_get_config(cursor->seat); |
191 | if (!sc) { | 196 | if (!sc) { |
192 | sc = seat_get_config_by_name("*"); | 197 | sc = seat_get_config_by_name("*"); |
@@ -299,7 +304,6 @@ void dispatch_cursor_button(struct sway_cursor *cursor, | |||
299 | static void handle_cursor_button(struct wl_listener *listener, void *data) { | 304 | static void handle_cursor_button(struct wl_listener *listener, void *data) { |
300 | struct sway_cursor *cursor = wl_container_of(listener, cursor, button); | 305 | struct sway_cursor *cursor = wl_container_of(listener, cursor, button); |
301 | struct wlr_event_pointer_button *event = data; | 306 | struct wlr_event_pointer_button *event = data; |
302 | cursor_handle_activity(cursor); | ||
303 | 307 | ||
304 | if (event->state == WLR_BUTTON_PRESSED) { | 308 | if (event->state == WLR_BUTTON_PRESSED) { |
305 | cursor->pressed_button_count++; | 309 | cursor->pressed_button_count++; |
@@ -311,6 +315,7 @@ static void handle_cursor_button(struct wl_listener *listener, void *data) { | |||
311 | } | 315 | } |
312 | } | 316 | } |
313 | 317 | ||
318 | cursor_handle_activity(cursor); | ||
314 | dispatch_cursor_button(cursor, event->device, | 319 | dispatch_cursor_button(cursor, event->device, |
315 | event->time_msec, event->button, event->state); | 320 | event->time_msec, event->button, event->state); |
316 | transaction_commit_dirty(); | 321 | transaction_commit_dirty(); |