summaryrefslogtreecommitdiff
path: root/src/Compositor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Compositor.cpp')
-rw-r--r--src/Compositor.cpp16
1 files changed, 15 insertions, 1 deletions
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);
+}
+