From 6d7dc70f663891ef39dcfb8ba8e5ff643b4d9ed8 Mon Sep 17 00:00:00 2001 From: "Cascade aka. Isoheptane" <38118922+Isoheptane@users.noreply.github.com> Date: Thu, 28 Sep 2023 02:49:30 +0800 Subject: input: Add map to region options for tablets (#3425) * Add region remap for tablets * Fix code style --- src/managers/input/InputManager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/managers/input/InputManager.cpp') 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(®ION)) + wlr_cursor_map_input_to_region(g_pCompositor->m_sWLRCursor, t.wlrDevice, ®ION); } } } -- cgit v1.2.3