diff options
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r-- | sway/input/cursor.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 1fa5be34..3e8fd5d8 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -147,10 +147,10 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor, uint32_t time_msec, | |||
147 | 147 | ||
148 | // Find the container the pointer was previously over | 148 | // Find the container the pointer was previously over |
149 | struct sway_container *prev_c = container_at_coords(cursor->seat, | 149 | struct sway_container *prev_c = container_at_coords(cursor->seat, |
150 | cursor->previous->x, cursor->previous->y, &surface, &sx, &sy); | 150 | cursor->previous.x, cursor->previous.y, &surface, &sx, &sy); |
151 | // Update the stored previous position | 151 | // Update the stored previous position |
152 | cursor->previous->x = cursor->cursor->x; | 152 | cursor->previous.x = cursor->cursor->x; |
153 | cursor->previous->y = cursor->cursor->y; | 153 | cursor->previous.y = cursor->cursor->y; |
154 | 154 | ||
155 | struct sway_container *c = container_at_coords(cursor->seat, | 155 | struct sway_container *c = container_at_coords(cursor->seat, |
156 | cursor->cursor->x, cursor->cursor->y, &surface, &sx, &sy); | 156 | cursor->cursor->x, cursor->cursor->y, &surface, &sx, &sy); |
@@ -476,15 +476,8 @@ struct sway_cursor *sway_cursor_create(struct sway_seat *seat) { | |||
476 | return NULL; | 476 | return NULL; |
477 | } | 477 | } |
478 | 478 | ||
479 | struct cursor_position *previous = calloc(1, sizeof(struct cursor_position)); | ||
480 | if (!sway_assert(previous, "could not allocate sway cursor position")) { | ||
481 | free(cursor); | ||
482 | return NULL; | ||
483 | } | ||
484 | |||
485 | struct wlr_cursor *wlr_cursor = wlr_cursor_create(); | 479 | struct wlr_cursor *wlr_cursor = wlr_cursor_create(); |
486 | if (!sway_assert(wlr_cursor, "could not allocate wlr cursor")) { | 480 | if (!sway_assert(wlr_cursor, "could not allocate wlr cursor")) { |
487 | free(previous); | ||
488 | free(cursor); | 481 | free(cursor); |
489 | return NULL; | 482 | return NULL; |
490 | } | 483 | } |
@@ -535,7 +528,6 @@ struct sway_cursor *sway_cursor_create(struct sway_seat *seat) { | |||
535 | cursor->request_set_cursor.notify = handle_request_set_cursor; | 528 | cursor->request_set_cursor.notify = handle_request_set_cursor; |
536 | 529 | ||
537 | cursor->cursor = wlr_cursor; | 530 | cursor->cursor = wlr_cursor; |
538 | cursor->previous = previous; | ||
539 | 531 | ||
540 | return cursor; | 532 | return cursor; |
541 | } | 533 | } |