added general:no_cursor_warps

This commit is contained in:
vaxerski
2022-08-01 18:50:16 +02:00
parent 338865e433
commit 1edd66618f
4 changed files with 21 additions and 5 deletions

View File

@@ -1501,4 +1501,18 @@ void CCompositor::startHyprCtlTick() {
hyprCtlTickSource = wl_event_loop_add_timer(m_sWLEventLoop, hyprCtlTick, nullptr);
wl_event_source_timer_update(hyprCtlTickSource, 16);
}
}
void CCompositor::warpCursorTo(const Vector2D& pos) {
// warpCursorTo should only be used for warps that
// should be disabled with no_cursor_warps
static auto *const PNOWARPS = &g_pConfigManager->getConfigValuePtr("general:no_cursor_warps")->intValue;
if (*PNOWARPS)
return;
wlr_cursor_warp(m_sWLRCursor, m_sSeat.mouse->mouse, pos.x, pos.y);
}