diff --git a/source/wayland/display.c b/source/wayland/display.c index c4240b0a0..a8f3e236b 100644 --- a/source/wayland/display.c +++ b/source/wayland/display.c @@ -1210,8 +1210,19 @@ static gboolean wayland_cursor_reload_theme(guint scale) { } cursor_size *= scale; + char *cursor_name; + if(wayland->cursor.theme_name == NULL) { + char *env_cursor_theme = (char *)g_getenv("XCURSOR_THEME"); + if(strlen(env_cursor_theme) > 0) { + cursor_name = env_cursor_theme; + } + } + else { + cursor_name = wayland->cursor.theme_name; + } + wayland->cursor.theme = - wl_cursor_theme_load(wayland->cursor.theme_name, cursor_size, wayland->shm); + wl_cursor_theme_load(cursor_name, cursor_size, wayland->shm); if (wayland->cursor.theme != NULL) { const char *const *cname = (const char *const *)wayland->cursor.name; for (cname = (cname != NULL) ? cname : wayland_cursor_names;