[libinput] Re-run touchscreen->output mapping when externally clearing output name
When setting a device's output name externally we assign the relevant output to the device If we pass an empty name we set a null output, which causes a crash the next time the touchscreen is touched Since passing an empty name semantically means 'Detect output automatically' rerun the mapping heuristic so we get a valid output
This commit is contained in:
parent
a054093580
commit
8986091878
1 changed files with 8 additions and 0 deletions
|
@ -277,6 +277,14 @@ void Connection::processEvents()
|
|||
applyDeviceConfig(device);
|
||||
applyScreenToDevice(device);
|
||||
|
||||
connect(device, &Device::outputNameChanged, this, [this, device] {
|
||||
// If the output name changes from something to empty we need to
|
||||
// re-run the assignment heuristic so that an output is assinged
|
||||
if (device->outputName().isEmpty()) {
|
||||
applyScreenToDevice(device);
|
||||
}
|
||||
});
|
||||
|
||||
Q_EMIT deviceAdded(device);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue