From 1edd66618f45a2e042260e4af81933d532e82394 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 1 Aug 2022 18:50:16 +0200 Subject: added general:no_cursor_warps --- src/Compositor.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/Compositor.cpp') diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 52dd634c..13689193 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1501,4 +1501,18 @@ void CCompositor::startHyprCtlTick() { hyprCtlTickSource = wl_event_loop_add_timer(m_sWLEventLoop, hyprCtlTick, nullptr); wl_event_source_timer_update(hyprCtlTickSource, 16); -} \ No newline at end of file +} + +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); +} + -- cgit v1.2.3