diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2018-01-16 21:16:04 +0100 |
---|---|---|
committer | Dominique Martinet <asmadeus@codewreck.org> | 2018-01-22 07:26:37 +0100 |
commit | 5766f426aac11bf39234dcca4c479ee865081dad (patch) | |
tree | 0d1917761854db5d79c5d7478e46e3082bf14b8f /sway/input/cursor.c | |
parent | commands: add 'reload' command (diff) | |
download | sway-5766f426aac11bf39234dcca4c479ee865081dad.tar.gz sway-5766f426aac11bf39234dcca4c479ee865081dad.tar.zst sway-5766f426aac11bf39234dcca4c479ee865081dad.zip |
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
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r-- | sway/input/cursor.c | 10 |
1 files changed, 10 insertions, 0 deletions
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, | |||
149 | wlr_log(L_DEBUG, "TODO: handle request set cursor event: %p", event); | 149 | wlr_log(L_DEBUG, "TODO: handle request set cursor event: %p", event); |
150 | } | 150 | } |
151 | 151 | ||
152 | void sway_cursor_destroy(struct sway_cursor *cursor) { | ||
153 | if (!cursor) { | ||
154 | return; | ||
155 | } | ||
156 | |||
157 | wlr_xcursor_manager_destroy(cursor->xcursor_manager); | ||
158 | wlr_cursor_destroy(cursor->cursor); | ||
159 | free(cursor); | ||
160 | } | ||
161 | |||
152 | struct sway_cursor *sway_cursor_create(struct sway_seat *seat) { | 162 | struct sway_cursor *sway_cursor_create(struct sway_seat *seat) { |
153 | struct sway_cursor *cursor = calloc(1, sizeof(struct sway_cursor)); | 163 | struct sway_cursor *cursor = calloc(1, sizeof(struct sway_cursor)); |
154 | if (!sway_assert(cursor, "could not allocate sway cursor")) { | 164 | if (!sway_assert(cursor, "could not allocate sway cursor")) { |