input: Add map to region options for tablets (#3425)

* Add region remap for tablets

* Fix code style
This commit is contained in:
Cascade aka. Isoheptane
2023-09-28 02:49:30 +08:00
committed by GitHub
parent ffacd2efd1
commit 6d7dc70f66
3 changed files with 25 additions and 0 deletions

View File

@@ -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);
}
}
}