diff options
author | Tudor Brindus <me@tbrindus.ca> | 2020-04-20 17:52:52 -0400 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-04-24 18:51:22 +0200 |
commit | 3de1a3958eb43521fe5d8e3773b9a1141efb18cb (patch) | |
tree | 03d229aea457c85ef6940939489d6ab6488ce40c /sway/config | |
parent | 65302093cfef884bb0a0f86d19e842255186423c (diff) |
config/output: reconfigure input devices on new output
Some input rules, like `map_to_output`, are dependent on a specific
screen being present. This currently does not work for hotplugged
outputs, or outputs that are processed after the input device is
initially probed.
This commit fixes both cases, by reconfiguring inputs on each output
addition.
Fixes #5231.
Diffstat (limited to 'sway/config')
-rw-r--r-- | sway/config/output.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sway/config/output.c b/sway/config/output.c index 19b9989a..9720bbf3 100644 --- a/sway/config/output.c +++ b/sway/config/output.c @@ -388,6 +388,17 @@ static void queue_output_config(struct output_config *oc, oc->adaptive_sync); wlr_output_enable_adaptive_sync(wlr_output, oc->adaptive_sync == 1); } + + // Reconfigure all devices, since input config may have been applied before + // this output came online, and some config items (like map_to_output) are + // dependent on an output being present. + struct sway_input_device *input_device = NULL; + wl_list_for_each(input_device, &server.input->devices, link) { + struct sway_seat *seat = NULL; + wl_list_for_each(seat, &server.input->seats, link) { + seat_configure_device(seat, input_device); + } + } } bool apply_output_config(struct output_config *oc, struct sway_output *output) { |