From 5766f426aac11bf39234dcca4c479ee865081dad Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Tue, 16 Jan 2018 21:16:04 +0100 Subject: config reload: destroy old seat when removed from config This adds new sway_seat_destroy and sway_cursor_destroy helpers and compare new and old config on free --- sway/input/cursor.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sway/input/cursor.c') diff --git a/sway/input/cursor.c b/sway/input/cursor.c index e6a4eca8..73a8ec5c 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -149,6 +149,16 @@ static void handle_request_set_cursor(struct wl_listener *listener, wlr_log(L_DEBUG, "TODO: handle request set cursor event: %p", event); } +void sway_cursor_destroy(struct sway_cursor *cursor) { + if (!cursor) { + return; + } + + wlr_xcursor_manager_destroy(cursor->xcursor_manager); + wlr_cursor_destroy(cursor->cursor); + free(cursor); +} + struct sway_cursor *sway_cursor_create(struct sway_seat *seat) { struct sway_cursor *cursor = calloc(1, sizeof(struct sway_cursor)); if (!sway_assert(cursor, "could not allocate sway cursor")) { -- cgit v1.2.3-54-g00ecf