From d092170bf8250166fe23f4c9f5049f204fb10851 Mon Sep 17 00:00:00 2001 From: Ivan Date: Sat, 28 Aug 2021 02:04:14 +0300 Subject: 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) --- video/out/wayland_common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'video/out/wayland_common.c') diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 9b901d9f40..479c06cd8e 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -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; -- cgit v1.2.3