From ebe5399ed6bfa59f5f5d289bf3d46b08f60787b3 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Thu, 31 Jan 2019 22:58:52 -0500 Subject: 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. --- sway/config/seat.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sway/config') 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) { return NULL; } seat->hide_cursor_timeout = -1; - seat->allow_constrain = true; + seat->allow_constrain = CONSTRAIN_DEFAULT; return seat; } @@ -143,6 +143,10 @@ void merge_seat_config(struct seat_config *dest, struct seat_config *source) { if (source->hide_cursor_timeout != -1) { dest->hide_cursor_timeout = source->hide_cursor_timeout; } + + if (source->allow_constrain != CONSTRAIN_DEFAULT) { + dest->allow_constrain = source->allow_constrain; + } } struct seat_config *copy_seat_config(struct seat_config *seat) { -- cgit v1.2.3-54-g00ecf