commit a34d785a26c9180de62530593b6693ca4c0b3615
parent 91079079690c8832b22960403f0e60c63822d17a
Author: Simon Ser <contact@emersion.fr>
Date: Thu, 13 Jul 2023 09:50:59 +0200
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:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/swaynag/swaynag.c b/swaynag/swaynag.c
@@ -153,8 +153,16 @@ static void update_cursor(struct swaynag_seat *seat) {
}
pointer->cursor_theme = wl_cursor_theme_load(
cursor_theme, cursor_size * swaynag->scale, swaynag->shm);
+ if (!pointer->cursor_theme) {
+ sway_log(SWAY_ERROR, "Failed to load cursor theme");
+ return;
+ }
struct wl_cursor *cursor =
wl_cursor_theme_get_cursor(pointer->cursor_theme, "default");
+ if (!cursor) {
+ sway_log(SWAY_ERROR, "Failed to get default cursor from theme");
+ return;
+ }
pointer->cursor_image = cursor->images[0];
wl_surface_set_buffer_scale(pointer->cursor_surface,
swaynag->scale);