[Input] Unset device group user data on teardown
BUG: 436287
This commit is contained in:
parent
04c3bee803
commit
ccc5551ff0
1 changed files with 11 additions and 2 deletions
|
@ -1612,7 +1612,14 @@ public:
|
||||||
tabletSeat->addTabletPad(device->sysName(), device->name(), {QString::fromUtf8(devnode)}, buttonsCount, ringsCount, stripsCount, modes, libinput_tablet_pad_mode_group_get_mode(firstGroup), tablet);
|
tabletSeat->addTabletPad(device->sysName(), device->name(), {QString::fromUtf8(devnode)}, buttonsCount, ringsCount, stripsCount, modes, libinput_tablet_pad_mode_group_get_mode(firstGroup), tablet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void removeDevice(const QString &sysname)
|
|
||||||
|
void removeDevice(LibInput::Device *device)
|
||||||
|
{
|
||||||
|
auto deviceGroup = libinput_device_get_device_group(device->device());
|
||||||
|
libinput_device_group_set_user_data(deviceGroup, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
void removeDeviceBySysName(const QString &sysname)
|
||||||
{
|
{
|
||||||
KWaylandServer::TabletSeatV2Interface *tabletSeat = findTabletSeat();
|
KWaylandServer::TabletSeatV2Interface *tabletSeat = findTabletSeat();
|
||||||
if (tabletSeat)
|
if (tabletSeat)
|
||||||
|
@ -2258,7 +2265,9 @@ void InputRedirection::setupInputFilters()
|
||||||
m_tabletSupport->integrateDevice(dev);
|
m_tabletSupport->integrateDevice(dev);
|
||||||
}
|
}
|
||||||
connect(m_libInput, &LibInput::Connection::deviceAdded, m_tabletSupport, &TabletInputFilter::integrateDevice);
|
connect(m_libInput, &LibInput::Connection::deviceAdded, m_tabletSupport, &TabletInputFilter::integrateDevice);
|
||||||
connect(m_libInput, &LibInput::Connection::deviceRemovedSysName, m_tabletSupport, &TabletInputFilter::removeDevice);
|
connect(m_libInput, &LibInput::Connection::deviceRemoved, m_tabletSupport, &TabletInputFilter::removeDevice);
|
||||||
|
|
||||||
|
connect(m_libInput, &LibInput::Connection::deviceRemovedSysName, m_tabletSupport, &TabletInputFilter::removeDeviceBySysName);
|
||||||
installInputEventFilter(m_tabletSupport);
|
installInputEventFilter(m_tabletSupport);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue