[client] wayland: respect XCURSOR_THEME and XCURSOR_SIZE env variables

This commit is contained in:
Quantum 2021-08-14 06:39:50 -04:00 committed by Geoffrey McRae
parent d35c448058
commit 2dd1ad53f8

View File

@ -142,7 +142,18 @@ bool waylandCursorInit(void)
wl_surface_commit(wlWm.cursors[LG_POINTER_SQUARE]); wl_surface_commit(wlWm.cursors[LG_POINTER_SQUARE]);
} }
wlWm.cursorTheme = wl_cursor_theme_load(NULL, 24, wlWm.shm); const char * cursorTheme = getenv("XCURSOR_THEME");
const char * cursorSizeEnv = getenv("XCURSOR_SIZE");
int cursorSize = 24;
if (cursorSizeEnv)
{
int size = atoi(cursorSizeEnv);
if (size)
cursorSize = size;
}
wlWm.cursorTheme = wl_cursor_theme_load(cursorTheme, cursorSize, wlWm.shm);
if (wlWm.cursorTheme) if (wlWm.cursorTheme)
for (LG_DSPointer pointer = LG_POINTER_ARROW; pointer < LG_POINTER_COUNT; ++pointer) for (LG_DSPointer pointer = LG_POINTER_ARROW; pointer < LG_POINTER_COUNT; ++pointer)
for (const char ** names = nameLists[pointer]; *names; ++names) for (const char ** names = nameLists[pointer]; *names; ++names)