[gnome-settings-daemon] common: Ensure screen integrated devices get remapped on hotplug



commit 1c1a4201a6456892ba50f9a8ffec2e5cf0c90ec3
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Jan 5 18:38:30 2018 +0100

    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

 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 c9a113c..fae4150 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);
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]