aboutsummaryrefslogtreecommitdiff
path: root/swaynag
diff options
context:
space:
mode:
authorIan Fan <ianfan0@gmail.com>2018-08-10 18:34:23 +0100
committerIan Fan <ianfan0@gmail.com>2018-08-10 18:34:23 +0100
commit6e7052fc441e6107a440f545951a1a99fce0fd4f (patch)
tree243a36bc46002e6b4392ea512801047a084ec5e5 /swaynag
parentc7e99ee0d49d2d62339a041495fde3f1b160133a (diff)
swaynag: destroy old cursor theme when updated
Diffstat (limited to 'swaynag')
-rw-r--r--swaynag/swaynag.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/swaynag/swaynag.c b/swaynag/swaynag.c
index 3764071e..26d3589e 100644
--- a/swaynag/swaynag.c
+++ b/swaynag/swaynag.c
@@ -110,6 +110,9 @@ static struct wl_surface_listener surface_listener = {
static void update_cursor(struct swaynag *swaynag) {
struct swaynag_pointer *pointer = &swaynag->pointer;
+ if (swaynag->pointer.cursor_theme) {
+ wl_cursor_theme_destroy(swaynag->pointer.cursor_theme);
+ }
pointer->cursor_theme = wl_cursor_theme_load(NULL, 24 * swaynag->scale,
swaynag->shm);
struct wl_cursor *cursor =