diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2018-01-05 18:38:30 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2018-01-15 11:22:16 +0100 |
commit | 1c1a4201a6456892ba50f9a8ffec2e5cf0c90ec3 (patch) | |
tree | 5a48116cf682d978bc2d88643a4568aa3dfd0ea0 | |
parent | bc732cd6c7c7e22b0f8df7c6a4046b5303eff5eb (diff) | |
download | gnome-settings-daemon-1c1a4201a6456892ba50f9a8ffec2e5cf0c90ec3.tar.gz |
common: Ensure screen integrated devices get remapped on hotplug
GsdDeviceMapper used to refrain from remapping devices that already had
a configured output. This however results on wrong mapping when the input
device is plugged before the output, since the heuristics will attempt
really hard to find an output for the device before the real one is
available, and not remapped again when the output is plugged.
Fix this by forcing remapping on all screen-integrated devices on every
hotplug event, so the input device will get remapped to the right screen
(hopefully!) when it is plugged. This is not applied to devices mapped
to the builtin output, or those with no attached output at all, as in both
of these cases the configured output should be left static.
https://bugzilla.gnome.org/show_bug.cgi?id=748589
-rw-r--r-- | plugins/common/gsd-device-mapper.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/common/gsd-device-mapper.c b/plugins/common/gsd-device-mapper.c index c9a113c4..fae4150f 100644 --- a/plugins/common/gsd-device-mapper.c +++ b/plugins/common/gsd-device-mapper.c @@ -603,10 +603,15 @@ mapper_recalculate_candidates (GsdDeviceMapper *mapper) input_info_update_settings_output (input); - /* Device has an output from settings */ - if (input->output) + /* Avoid opaque device with an output from settings and + * system-integrated devices that won't get remapped anyway + */ + if (input->output && + (input->capabilities & GSD_INPUT_IS_SCREEN_INTEGRATED) == 0) continue; + /* reset the current output */ + input_info_set_output (input, NULL, FALSE, FALSE); input_info_guess_candidates (input, outputs); mapping_helper_add (helper, input, outputs); } |