diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2023-07-13 09:50:59 +0200 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2023-07-13 09:50:59 +0200 |
| commit | a2648e0ff0d25d99e8b821a0f338de03e94a4e94 (patch) | |
| tree | b24acb8698756228363c8ed0c0a33391e9509134 | |
| parent | c5331411d5f4828142404ac22ef47d60819dab4d (diff) | |
swaynag: handle wayland-cursor failures
Same as 6bd6491af691 ("swaybar: handle wayland-cursor failures")
but for swaynag.
Closes: https://github.com/swaywm/sway/issues/7671
| -rw-r--r-- | swaynag/swaynag.c | 8 |
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) { } 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); |
