0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 20:03:10 +02: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:
Ivan 2021-08-28 02:04:14 +03:00 committed by Dudemanguy
parent f3a2275c24
commit d092170bf8

View File

@ -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;