summaryrefslogtreecommitdiffstats
path: root/sway/config
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-01-31 22:58:52 -0500
committerLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-01-31 22:58:52 -0500
commitebe5399ed6bfa59f5f5d289bf3d46b08f60787b3 (patch)
treeca0bff9d26283b0fa790855e7379e8da2e89166b /sway/config
parentRebase #1636 against current master (diff)
downloadsway-ebe5399ed6bfa59f5f5d289bf3d46b08f60787b3.tar.gz
sway-ebe5399ed6bfa59f5f5d289bf3d46b08f60787b3.tar.zst
sway-ebe5399ed6bfa59f5f5d289bf3d46b08f60787b3.zip
pointer_constraint: change to a seat subcommand
This changes the `pointer_constraint` command to be a subcommand of seat to allow for per-seat settings. The current implementation that is not a seat subcommand will only operate on the current seat and will segfault in the config due to `config->handler_context.seat` only being set at runtime. This also allows for the wildcard identifier to be used to alter the pointer constraint settings on all seats and allows for the setting to be merged with the rest of the seat config.
Diffstat (limited to 'sway/config')
-rw-r--r--sway/config/seat.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sway/config/seat.c b/sway/config/seat.c
index 541c4f99..04a44e3a 100644
--- a/sway/config/seat.c
+++ b/sway/config/seat.c
@@ -26,7 +26,7 @@ struct seat_config *new_seat_config(const char* name) {
26 return NULL; 26 return NULL;
27 } 27 }
28 seat->hide_cursor_timeout = -1; 28 seat->hide_cursor_timeout = -1;
29 seat->allow_constrain = true; 29 seat->allow_constrain = CONSTRAIN_DEFAULT;
30 30
31 return seat; 31 return seat;
32} 32}
@@ -143,6 +143,10 @@ void merge_seat_config(struct seat_config *dest, struct seat_config *source) {
143 if (source->hide_cursor_timeout != -1) { 143 if (source->hide_cursor_timeout != -1) {
144 dest->hide_cursor_timeout = source->hide_cursor_timeout; 144 dest->hide_cursor_timeout = source->hide_cursor_timeout;
145 } 145 }
146
147 if (source->allow_constrain != CONSTRAIN_DEFAULT) {
148 dest->allow_constrain = source->allow_constrain;
149 }
146} 150}
147 151
148struct seat_config *copy_seat_config(struct seat_config *seat) { 152struct seat_config *copy_seat_config(struct seat_config *seat) {