add seat sub command 'xcursor_theme'

New 'seat <name> xcursor_theme <theme> [<size>]' command that
configures the default xcursor theme.

The default seat's xcursor theme is also propagated to XWayland, and
exported through the XCURSOR_THEME and XCURSOR_SIZE environment
variables. This is done every time the default seat's configuration is
changed.
This commit is contained in:
Daniel Eklöf 2019-06-01 21:05:09 +02:00 committed by Drew DeVault
parent 799f5a2cd5
commit 190546fd31
9 changed files with 119 additions and 29 deletions

View file

@ -27,6 +27,8 @@ struct seat_config *new_seat_config(const char* name) {
}
seat->hide_cursor_timeout = -1;
seat->allow_constrain = CONSTRAIN_DEFAULT;
seat->xcursor_theme.name = NULL;
seat->xcursor_theme.size = 24;
return seat;
}
@ -147,6 +149,12 @@ void merge_seat_config(struct seat_config *dest, struct seat_config *source) {
if (source->allow_constrain != CONSTRAIN_DEFAULT) {
dest->allow_constrain = source->allow_constrain;
}
if (source->xcursor_theme.name != NULL) {
free(dest->xcursor_theme.name);
dest->xcursor_theme.name = strdup(source->xcursor_theme.name);
dest->xcursor_theme.size = source->xcursor_theme.size;
}
}
struct seat_config *copy_seat_config(struct seat_config *seat) {
@ -170,6 +178,7 @@ void free_seat_config(struct seat_config *seat) {
seat_attachment_config_free(seat->attachments->items[i]);
}
list_free(seat->attachments);
free(seat->xcursor_theme.name);
free(seat);
}