mirror of
https://github.com/NickHu/sway
synced 2024-12-27 21:58:11 +01:00
swaynag: handle wayland-cursor failures
Same as 92244c87db
("swaybar: handle wayland-cursor failures")
but for swaynag.
Closes: https://github.com/swaywm/sway/issues/7671
This commit is contained in:
parent
9107907969
commit
a34d785a26
1 changed files with 8 additions and 0 deletions
|
@ -153,8 +153,16 @@ static void update_cursor(struct swaynag_seat *seat) {
|
||||||
}
|
}
|
||||||
pointer->cursor_theme = wl_cursor_theme_load(
|
pointer->cursor_theme = wl_cursor_theme_load(
|
||||||
cursor_theme, cursor_size * swaynag->scale, swaynag->shm);
|
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 =
|
struct wl_cursor *cursor =
|
||||||
wl_cursor_theme_get_cursor(pointer->cursor_theme, "default");
|
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];
|
pointer->cursor_image = cursor->images[0];
|
||||||
wl_surface_set_buffer_scale(pointer->cursor_surface,
|
wl_surface_set_buffer_scale(pointer->cursor_surface,
|
||||||
swaynag->scale);
|
swaynag->scale);
|
||||||
|
|
Loading…
Reference in a new issue