add disabling pointer devices
This commit is contained in:
parent
d5a0610ea2
commit
28c81fc71e
3 changed files with 16 additions and 0 deletions
|
|
@ -683,6 +683,8 @@ void CInputManager::newMouse(wlr_input_device* mouse, bool virt) {
|
|||
|
||||
wlr_cursor_attach_input_device(g_pCompositor->m_sWLRCursor, mouse);
|
||||
|
||||
PMOUSE->connected = true;
|
||||
|
||||
g_pCompositor->m_sSeat.mouse = PMOUSE;
|
||||
|
||||
m_tmrLastCursorMovement.reset();
|
||||
|
|
@ -699,6 +701,17 @@ void CInputManager::setPointerConfigs() {
|
|||
|
||||
const auto HASCONFIG = g_pConfigManager->deviceConfigExists(devname);
|
||||
|
||||
if (HASCONFIG) {
|
||||
const auto ENABLED = g_pConfigManager->getDeviceInt(devname, "enabled");
|
||||
if (ENABLED && !m.connected) {
|
||||
wlr_cursor_attach_input_device(g_pCompositor->m_sWLRCursor, m.mouse);
|
||||
m.connected = true;
|
||||
} else if (!ENABLED && m.connected) {
|
||||
wlr_cursor_detach_input_device(g_pCompositor->m_sWLRCursor, m.mouse);
|
||||
m.connected = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (wlr_input_device_is_libinput(m.mouse)) {
|
||||
const auto LIBINPUTDEV = (libinput_device*)wlr_libinput_get_device_handle(m.mouse);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue