mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-26 14:45:58 +01:00
Add cursor theme to rootston config
This commit is contained in:
parent
bf5640db12
commit
cd566ccd8e
5 changed files with 10 additions and 3 deletions
|
@ -48,6 +48,7 @@ struct roots_config {
|
|||
struct {
|
||||
char *mapped_output;
|
||||
struct wlr_box *mapped_box;
|
||||
char *theme;
|
||||
} cursor;
|
||||
|
||||
struct wl_list outputs;
|
||||
|
|
|
@ -276,6 +276,9 @@ static int config_ini_handler(void *user, const char *section, const char *name,
|
|||
} else if (strcmp(name, "geometry") == 0) {
|
||||
free(config->cursor.mapped_box);
|
||||
config->cursor.mapped_box = parse_geometry(value);
|
||||
} else if (strcmp(name, "theme") == 0) {
|
||||
free(config->cursor.theme);
|
||||
config->cursor.theme = strdup(value);
|
||||
} else {
|
||||
wlr_log(L_ERROR, "got unknown cursor config: %s", name);
|
||||
}
|
||||
|
|
|
@ -338,10 +338,11 @@ struct roots_desktop *desktop_create(struct roots_server *server,
|
|||
desktop->server = server;
|
||||
desktop->config = config;
|
||||
|
||||
desktop->xcursor_manager = wlr_xcursor_manager_create(NULL,
|
||||
desktop->xcursor_manager = wlr_xcursor_manager_create(config->cursor.theme,
|
||||
ROOTS_XCURSOR_SIZE);
|
||||
if (desktop->xcursor_manager == NULL) {
|
||||
wlr_log(L_ERROR, "Cannot create XCursor manager");
|
||||
wlr_log(L_ERROR, "Cannot create XCursor manager for theme %s",
|
||||
config->cursor.theme);
|
||||
wlr_list_free(desktop->views);
|
||||
free(desktop);
|
||||
return NULL;
|
||||
|
|
|
@ -21,6 +21,8 @@ rotate = 90
|
|||
map-to-output = VGA-1
|
||||
# Restrict cursor movements to concrete rectangle
|
||||
geometry = 2500x800
|
||||
# Load a custom XCursor theme
|
||||
theme = default
|
||||
|
||||
# Single device configuration. String after semicolon must match device's name.
|
||||
[device:PixArt Dell MS116 USB Optical Mouse]
|
||||
|
|
|
@ -46,7 +46,7 @@ int wlr_xcursor_manager_load(struct wlr_xcursor_manager *manager,
|
|||
return 1;
|
||||
}
|
||||
theme->scale = scale;
|
||||
theme->theme = wlr_xcursor_theme_load(NULL, manager->size * scale);
|
||||
theme->theme = wlr_xcursor_theme_load(manager->name, manager->size * scale);
|
||||
if (theme->theme == NULL) {
|
||||
free(theme);
|
||||
return 1;
|
||||
|
|
Loading…
Reference in a new issue