summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan <etircopyhdot@gmail.com>2021-08-28 02:04:14 +0300
committerDudemanguy <random342@airmail.cc>2021-08-28 01:12:38 +0000
commitd092170bf8250166fe23f4c9f5049f204fb10851 (patch)
tree8ab39d8d488c4ee061d52412a115f1da9c5aa26a
parentf3a2275c24db3b2204ceda93fa37bd59790e7701 (diff)
downloadmpv-d092170bf8250166fe23f4c9f5049f204fb10851.tar.bz2
mpv-d092170bf8250166fe23f4c9f5049f204fb10851.tar.xz
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)
-rw-r--r--video/out/wayland_common.c3
1 files changed, 2 insertions, 1 deletions
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;