diff options
author | Daniel Eklöf <daniel@ekloef.se> | 2019-06-01 21:05:09 +0200 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-06-05 11:00:10 -0400 |
commit | 190546fd315a24c04006fb1b177069933f4350da (patch) | |
tree | db0910b4931625d259f14b22a56b54095a8466bd /sway/config | |
parent | cmd_hide_edge_borders: add missing arg count check (diff) | |
download | sway-190546fd315a24c04006fb1b177069933f4350da.tar.gz sway-190546fd315a24c04006fb1b177069933f4350da.tar.zst sway-190546fd315a24c04006fb1b177069933f4350da.zip |
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.
Diffstat (limited to 'sway/config')
-rw-r--r-- | sway/config/seat.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sway/config/seat.c b/sway/config/seat.c index 04a44e3a..d4190cec 100644 --- a/sway/config/seat.c +++ b/sway/config/seat.c | |||
@@ -27,6 +27,8 @@ struct seat_config *new_seat_config(const char* name) { | |||
27 | } | 27 | } |
28 | seat->hide_cursor_timeout = -1; | 28 | seat->hide_cursor_timeout = -1; |
29 | seat->allow_constrain = CONSTRAIN_DEFAULT; | 29 | seat->allow_constrain = CONSTRAIN_DEFAULT; |
30 | seat->xcursor_theme.name = NULL; | ||
31 | seat->xcursor_theme.size = 24; | ||
30 | 32 | ||
31 | return seat; | 33 | return seat; |
32 | } | 34 | } |
@@ -147,6 +149,12 @@ void merge_seat_config(struct seat_config *dest, struct seat_config *source) { | |||
147 | if (source->allow_constrain != CONSTRAIN_DEFAULT) { | 149 | if (source->allow_constrain != CONSTRAIN_DEFAULT) { |
148 | dest->allow_constrain = source->allow_constrain; | 150 | dest->allow_constrain = source->allow_constrain; |
149 | } | 151 | } |
152 | |||
153 | if (source->xcursor_theme.name != NULL) { | ||
154 | free(dest->xcursor_theme.name); | ||
155 | dest->xcursor_theme.name = strdup(source->xcursor_theme.name); | ||
156 | dest->xcursor_theme.size = source->xcursor_theme.size; | ||
157 | } | ||
150 | } | 158 | } |
151 | 159 | ||
152 | struct seat_config *copy_seat_config(struct seat_config *seat) { | 160 | struct seat_config *copy_seat_config(struct seat_config *seat) { |
@@ -170,6 +178,7 @@ void free_seat_config(struct seat_config *seat) { | |||
170 | seat_attachment_config_free(seat->attachments->items[i]); | 178 | seat_attachment_config_free(seat->attachments->items[i]); |
171 | } | 179 | } |
172 | list_free(seat->attachments); | 180 | list_free(seat->attachments); |
181 | free(seat->xcursor_theme.name); | ||
173 | free(seat); | 182 | free(seat); |
174 | } | 183 | } |
175 | 184 | ||