mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-05 06:31:57 -07:00
add disabling pointer devices
This commit is contained in:
@@ -193,6 +193,7 @@ void CConfigManager::setDeviceDefaultVars(const std::string& dev) {
|
||||
cfgValues["scroll_method"].strValue = STRVAL_EMPTY;
|
||||
cfgValues["touch_transform"].intValue = 0;
|
||||
cfgValues["touch_output"].strValue = STRVAL_EMPTY;
|
||||
cfgValues["enabled"].intValue = 1; // only for mice / touchpads
|
||||
}
|
||||
|
||||
void CConfigManager::setDefaultAnimationVars() {
|
||||
|
@@ -131,6 +131,8 @@ struct SMouse {
|
||||
|
||||
bool virt = false;
|
||||
|
||||
bool connected = false; // means connected to the cursor
|
||||
|
||||
DYNLISTENER(commitConstraint);
|
||||
DYNLISTENER(destroyMouse);
|
||||
|
||||
|
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user