cursor: respect XCURSOR_THEME and XCURSOR_SIZE environment variables
The xcursor manager was hardcoded to NULL theme with size 24. Now reads XCURSOR_THEME and XCURSOR_SIZE from the environment, matching the behavior of other Wayland compositors like Sway.
This commit is contained in:
parent
703872bcca
commit
9a4438fb65
|
|
@ -2682,7 +2682,13 @@ wl_display_open(const char *name)
|
|||
wl_state.cursor = wlr_cursor_create();
|
||||
if (wl_state.cursor) {
|
||||
wlr_cursor_attach_output_layout(wl_state.cursor, wl_state.output_layout);
|
||||
wl_state.xcursor_mgr = wlr_xcursor_manager_create(NULL, 24);
|
||||
{
|
||||
const char *theme = getenv("XCURSOR_THEME");
|
||||
const char *size_str = getenv("XCURSOR_SIZE");
|
||||
unsigned int size = size_str ? (unsigned int)atoi(size_str) : 24;
|
||||
if (size == 0) size = 24;
|
||||
wl_state.xcursor_mgr = wlr_xcursor_manager_create(theme, size);
|
||||
}
|
||||
if (wl_state.xcursor_mgr)
|
||||
wlr_xcursor_manager_load(wl_state.xcursor_mgr, 1.0f);
|
||||
wwarning("wl_backend: cursor created, xcursor theme loaded");
|
||||
|
|
|
|||
Loading…
Reference in New Issue