aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/cursor.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r--sway/input/cursor.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index eab102fd..afad6f6f 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -30,7 +30,7 @@
30// when dragging to the edge of a layout container. 30// when dragging to the edge of a layout container.
31#define DROP_LAYOUT_BORDER 30 31#define DROP_LAYOUT_BORDER 30
32 32
33static uint32_t get_current_time_msec() { 33static uint32_t get_current_time_msec(void) {
34 struct timespec now; 34 struct timespec now;
35 clock_gettime(CLOCK_MONOTONIC, &now); 35 clock_gettime(CLOCK_MONOTONIC, &now);
36 return now.tv_nsec / 1000; 36 return now.tv_nsec / 1000;
@@ -1007,8 +1007,7 @@ static void handle_touch_down(struct wl_listener *listener, void *data) {
1007 if (seat_is_input_allowed(seat, surface)) { 1007 if (seat_is_input_allowed(seat, surface)) {
1008 wlr_seat_touch_notify_down(wlr_seat, surface, event->time_msec, 1008 wlr_seat_touch_notify_down(wlr_seat, surface, event->time_msec,
1009 event->touch_id, sx, sy); 1009 event->touch_id, sx, sy);
1010 cursor->image_client = NULL; 1010 cursor_set_image(cursor, NULL, NULL);
1011 wlr_cursor_set_image(cursor->cursor, NULL, 0, 0, 0, 0, 0, 0);
1012 } 1011 }
1013} 1012}
1014 1013
@@ -1176,11 +1175,13 @@ static void handle_request_set_cursor(struct wl_listener *listener,
1176 1175
1177void cursor_set_image(struct sway_cursor *cursor, const char *image, 1176void cursor_set_image(struct sway_cursor *cursor, const char *image,
1178 struct wl_client *client) { 1177 struct wl_client *client) {
1179 if (!cursor->image || strcmp(cursor->image, image) != 0) { 1178 if (!image) {
1179 wlr_cursor_set_image(cursor->cursor, NULL, 0, 0, 0, 0, 0, 0);
1180 } else if (!cursor->image || strcmp(cursor->image, image) != 0) {
1180 wlr_xcursor_manager_set_cursor_image(cursor->xcursor_manager, image, 1181 wlr_xcursor_manager_set_cursor_image(cursor->xcursor_manager, image,
1181 cursor->cursor); 1182 cursor->cursor);
1182 cursor->image = image;
1183 } 1183 }
1184 cursor->image = image;
1184 cursor->image_client = client; 1185 cursor->image_client = client;
1185} 1186}
1186 1187