mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 04:26:00 +01:00
input: only configure newly added touch devices
This commit is contained in:
parent
a4c120d608
commit
12227d7b6a
2 changed files with 17 additions and 7 deletions
|
@ -1313,7 +1313,7 @@ void CInputManager::newTouchDevice(wlr_input_device* pDevice) {
|
||||||
Debug::log(ERR, "Touch Device had no name???"); // logic error
|
Debug::log(ERR, "Touch Device had no name???"); // logic error
|
||||||
}
|
}
|
||||||
|
|
||||||
setTouchDeviceConfigs();
|
setTouchDeviceConfigs(PNEWDEV);
|
||||||
wlr_cursor_attach_input_device(g_pCompositor->m_sWLRCursor, pDevice);
|
wlr_cursor_attach_input_device(g_pCompositor->m_sWLRCursor, pDevice);
|
||||||
|
|
||||||
Debug::log(LOG, "New touch device added at %lx", PNEWDEV);
|
Debug::log(LOG, "New touch device added at %lx", PNEWDEV);
|
||||||
|
@ -1322,14 +1322,13 @@ void CInputManager::newTouchDevice(wlr_input_device* pDevice) {
|
||||||
&pDevice->events.destroy, [&](void* owner, void* data) { destroyTouchDevice((STouchDevice*)data); }, PNEWDEV, "TouchDevice");
|
&pDevice->events.destroy, [&](void* owner, void* data) { destroyTouchDevice((STouchDevice*)data); }, PNEWDEV, "TouchDevice");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInputManager::setTouchDeviceConfigs() {
|
void CInputManager::setTouchDeviceConfigs(STouchDevice* dev) {
|
||||||
for (auto& m : m_lTouchDevices) {
|
|
||||||
const auto PTOUCHDEV = &m;
|
|
||||||
|
|
||||||
|
auto setConfig = [&](STouchDevice* const PTOUCHDEV) -> void {
|
||||||
const auto HASCONFIG = g_pConfigManager->deviceConfigExists(PTOUCHDEV->name);
|
const auto HASCONFIG = g_pConfigManager->deviceConfigExists(PTOUCHDEV->name);
|
||||||
|
|
||||||
if (wlr_input_device_is_libinput(m.pWlrDevice)) {
|
if (wlr_input_device_is_libinput(PTOUCHDEV->pWlrDevice)) {
|
||||||
const auto LIBINPUTDEV = (libinput_device*)wlr_libinput_get_device_handle(m.pWlrDevice);
|
const auto LIBINPUTDEV = (libinput_device*)wlr_libinput_get_device_handle(PTOUCHDEV->pWlrDevice);
|
||||||
|
|
||||||
const int ROTATION =
|
const int ROTATION =
|
||||||
std::clamp(HASCONFIG ? g_pConfigManager->getDeviceInt(PTOUCHDEV->name, "transform") : g_pConfigManager->getInt("input:touchdevice:transform"), 0, 7);
|
std::clamp(HASCONFIG ? g_pConfigManager->getDeviceInt(PTOUCHDEV->name, "transform") : g_pConfigManager->getInt("input:touchdevice:transform"), 0, 7);
|
||||||
|
@ -1342,6 +1341,17 @@ void CInputManager::setTouchDeviceConfigs() {
|
||||||
else
|
else
|
||||||
PTOUCHDEV->boundOutput = "";
|
PTOUCHDEV->boundOutput = "";
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (dev) {
|
||||||
|
setConfig(dev);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto& m : m_lTouchDevices) {
|
||||||
|
const auto PTOUCHDEV = &m;
|
||||||
|
|
||||||
|
setConfig(PTOUCHDEV);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ class CInputManager {
|
||||||
|
|
||||||
void setKeyboardLayout();
|
void setKeyboardLayout();
|
||||||
void setPointerConfigs();
|
void setPointerConfigs();
|
||||||
void setTouchDeviceConfigs();
|
void setTouchDeviceConfigs(STouchDevice* dev = nullptr);
|
||||||
void setTabletConfigs();
|
void setTabletConfigs();
|
||||||
|
|
||||||
void updateDragIcon();
|
void updateDragIcon();
|
||||||
|
|
Loading…
Reference in a new issue