Skip to content

Commit a34d785

Browse files
committed
swaynag: handle wayland-cursor failures
Same as 92244c8 ("swaybar: handle wayland-cursor failures") but for swaynag. Closes: #7671
1 parent 9107907 commit a34d785

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

swaynag/swaynag.c

+8
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,16 @@ static void update_cursor(struct swaynag_seat *seat) {
153153
}
154154
pointer->cursor_theme = wl_cursor_theme_load(
155155
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+
}
156160
struct wl_cursor *cursor =
157161
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+
}
158166
pointer->cursor_image = cursor->images[0];
159167
wl_surface_set_buffer_scale(pointer->cursor_surface,
160168
swaynag->scale);

0 commit comments

Comments
 (0)