diff --git a/src/config/parse_config.h b/src/config/parse_config.h index ffb8414..6ae9740 100644 --- a/src/config/parse_config.h +++ b/src/config/parse_config.h @@ -3604,6 +3604,20 @@ void reapply_monitor_rules(void) { updatemons(NULL, NULL); } +void set_xcursor_env() { + if (config.cursor_size > 0) { + char size_str[16]; + snprintf(size_str, sizeof(size_str), "%d", config.cursor_size); + setenv("XCURSOR_SIZE", size_str, 1); + } else { + setenv("XCURSOR_SIZE", "24", 1); + } + + if (config.cursor_theme) { + setenv("XCURSOR_THEME", config.cursor_theme, 1); + } +} + void reapply_cursor_style(void) { if (hide_cursor_source) { wl_event_source_timer_update(hide_cursor_source, 0); @@ -3620,19 +3634,11 @@ void reapply_cursor_style(void) { cursor_mgr = NULL; } + set_xcursor_env(); + cursor_mgr = wlr_xcursor_manager_create(config.cursor_theme, config.cursor_size); - if (config.cursor_size > 0) { - char size_str[16]; - snprintf(size_str, sizeof(size_str), "%d", config.cursor_size); - setenv("XCURSOR_SIZE", size_str, 1); - } - - if (config.cursor_theme) { - setenv("XCURSOR_THEME", config.cursor_theme, 1); - } - Monitor *m = NULL; wl_list_for_each(m, &mons, link) { wlr_xcursor_manager_load(cursor_mgr, m->wlr_output->scale); diff --git a/src/mango.c b/src/mango.c index 915c47b..3d36dd8 100644 --- a/src/mango.c +++ b/src/mango.c @@ -5653,22 +5653,11 @@ void setup(void) { * cursor images are available at all scale factors on the screen * (necessary for HiDPI support). Scaled cursors will be loaded with * each output. */ - // cursor_mgr = wlr_xcursor_manager_create(cursor_theme, 24); + + set_xcursor_env(); + cursor_mgr = wlr_xcursor_manager_create(config.cursor_theme, config.cursor_size); - - if (config.cursor_size > 0) { - char size_str[16]; - snprintf(size_str, sizeof(size_str), "%d", config.cursor_size); - setenv("XCURSOR_SIZE", size_str, 1); - } else { - setenv("XCURSOR_SIZE", "24", 1); - } - - if (config.cursor_theme) { - setenv("XCURSOR_THEME", config.cursor_theme, 1); - } - /* * wlr_cursor *only* displays an image on screen. It does not move * around when the pointer moves. However, we can attach input devices