summaryrefslogtreecommitdiff
path: root/src/managers/input/InputManager.cpp
diff options
context:
space:
mode:
authorCascade aka. Isoheptane <38118922+Isoheptane@users.noreply.github.com>2023-09-28 02:49:30 +0800
committerGitHub <noreply@github.com>2023-09-27 19:49:30 +0100
commit6d7dc70f663891ef39dcfb8ba8e5ff643b4d9ed8 (patch)
treefc7ec6c8dc545599ffabfc1df7ad9b734fc4a7ac /src/managers/input/InputManager.cpp
parentffacd2efd1ca7fdf364a519c9d8d8644da28412b (diff)
input: Add map to region options for tablets (#3425)
* Add region remap for tablets * Fix code style
Diffstat (limited to 'src/managers/input/InputManager.cpp')
-rw-r--r--src/managers/input/InputManager.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index ab633bc5..02ccfd1b 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -1444,6 +1444,12 @@ void CInputManager::setTabletConfigs() {
wlr_cursor_map_input_to_output(g_pCompositor->m_sWLRCursor, t.wlrDevice, PMONITOR->output);
wlr_cursor_map_input_to_region(g_pCompositor->m_sWLRCursor, t.wlrDevice, nullptr);
}
+
+ const auto REGION_POS = g_pConfigManager->getDeviceVec(t.name, "region_position", "input:tablet:region_position");
+ const auto REGION_SIZE = g_pConfigManager->getDeviceVec(t.name, "region_size", "input:tablet:region_size");
+ const auto REGION = wlr_box{REGION_POS.x, REGION_POS.y, REGION_SIZE.x, REGION_SIZE.y};
+ if (!wlr_box_empty(&REGION))
+ wlr_cursor_map_input_to_region(g_pCompositor->m_sWLRCursor, t.wlrDevice, &REGION);
}
}
}