mirror of
https://github.com/mpv-player/mpv
synced 2025-01-24 08:33:34 +00:00
wayland: read XCURSOR_THEME to get cursor theme
Read $XCURSOR_THEME environment variable if set and if not then fall back to "default" (/usr/share/icons/default and ~/.icons/default)
This commit is contained in:
parent
f3a2275c24
commit
d092170bf8
@ -1427,6 +1427,7 @@ static int spawn_cursor(struct vo_wayland_state *wl)
|
||||
else if (wl->cursor_theme)
|
||||
wl_cursor_theme_destroy(wl->cursor_theme);
|
||||
|
||||
const char *xcursor_theme = getenv("XCURSOR_THEME");
|
||||
const char *size_str = getenv("XCURSOR_SIZE");
|
||||
int size = 32;
|
||||
if (size_str != NULL) {
|
||||
@ -1437,7 +1438,7 @@ static int spawn_cursor(struct vo_wayland_state *wl)
|
||||
size = (int)size_long;
|
||||
}
|
||||
|
||||
wl->cursor_theme = wl_cursor_theme_load(NULL, size*wl->scaling, wl->shm);
|
||||
wl->cursor_theme = wl_cursor_theme_load(xcursor_theme, size*wl->scaling, wl->shm);
|
||||
if (!wl->cursor_theme) {
|
||||
MP_ERR(wl, "Unable to load cursor theme!\n");
|
||||
return 1;
|
||||
|
Loading…
Reference in New Issue
Block a user