aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-04-29 12:23:54 +0100
committeremersion <contact@emersion.fr>2018-04-29 14:30:13 +0100
commit9e7a997433016f366fef79de467d6e95ebabc552 (patch)
tree5e273e5e3ad210a1d577f3395ffd2ff7810772d8 /rootston
parent9f8a7c8fc4bbcbdd149c2892b13f06ba21931907 (diff)
rootston: map input devices with wlr_input_device.output_name
Diffstat (limited to 'rootston')
-rw-r--r--rootston/seat.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/rootston/seat.c b/rootston/seat.c
index 44673c75..cbc7c961 100644
--- a/rootston/seat.c
+++ b/rootston/seat.c
@@ -141,10 +141,18 @@ static void seat_set_device_output_mappings(struct roots_seat *seat,
struct wlr_input_device *device, struct wlr_output *output) {
struct wlr_cursor *cursor = seat->cursor->cursor;
struct roots_config *config = seat->input->config;
- struct roots_device_config *dconfig;
- dconfig = roots_config_get_device(config, device);
- if (dconfig && dconfig->mapped_output &&
- strcmp(dconfig->mapped_output, output->name) == 0) {
+ struct roots_device_config *dconfig =
+ roots_config_get_device(config, device);
+
+ const char *mapped_output = NULL;
+ if (dconfig != NULL) {
+ mapped_output = dconfig->mapped_output;
+ }
+ if (mapped_output == NULL) {
+ mapped_output = device->output_name;
+ }
+
+ if (mapped_output && strcmp(mapped_output, output->name) == 0) {
wlr_cursor_map_input_to_output(cursor, device, output);
}
}