aboutsummaryrefslogtreecommitdiffstats
path: root/swaynag/swaynag.c
diff options
context:
space:
mode:
authorLibravatar Simon Ser <contact@emersion.fr>2023-07-13 09:50:59 +0200
committerLibravatar Simon Ser <contact@emersion.fr>2023-07-17 10:01:46 +0200
commita34d785a26c9180de62530593b6693ca4c0b3615 (patch)
treeb24acb8698756228363c8ed0c0a33391e9509134 /swaynag/swaynag.c
parentchase wlroots 'presentation-time: add separate helper for zero-copy ' (diff)
downloadsway-a34d785a26c9180de62530593b6693ca4c0b3615.tar.gz
sway-a34d785a26c9180de62530593b6693ca4c0b3615.tar.zst
sway-a34d785a26c9180de62530593b6693ca4c0b3615.zip
swaynag: handle wayland-cursor failures
Same as 92244c87dbb8 ("swaybar: handle wayland-cursor failures") but for swaynag. Closes: https://github.com/swaywm/sway/issues/7671
Diffstat (limited to 'swaynag/swaynag.c')
-rw-r--r--swaynag/swaynag.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/swaynag/swaynag.c b/swaynag/swaynag.c
index 1b114e28..b45485f7 100644
--- a/swaynag/swaynag.c
+++ b/swaynag/swaynag.c
@@ -153,8 +153,16 @@ static void update_cursor(struct swaynag_seat *seat) {
153 } 153 }
154 pointer->cursor_theme = wl_cursor_theme_load( 154 pointer->cursor_theme = wl_cursor_theme_load(
155 cursor_theme, cursor_size * swaynag->scale, swaynag->shm); 155 cursor_theme, cursor_size * swaynag->scale, swaynag->shm);
156 if (!pointer->cursor_theme) {
157 sway_log(SWAY_ERROR, "Failed to load cursor theme");
158 return;
159 }
156 struct wl_cursor *cursor = 160 struct wl_cursor *cursor =
157 wl_cursor_theme_get_cursor(pointer->cursor_theme, "default"); 161 wl_cursor_theme_get_cursor(pointer->cursor_theme, "default");
162 if (!cursor) {
163 sway_log(SWAY_ERROR, "Failed to get default cursor from theme");
164 return;
165 }
158 pointer->cursor_image = cursor->images[0]; 166 pointer->cursor_image = cursor->images[0];
159 wl_surface_set_buffer_scale(pointer->cursor_surface, 167 wl_surface_set_buffer_scale(pointer->cursor_surface,
160 swaynag->scale); 168 swaynag->scale);