diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-08-01 18:50:16 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-08-01 18:50:16 +0200 |
| commit | 1edd66618f45a2e042260e4af81933d532e82394 (patch) | |
| tree | 081440260fab7a807616af33682af2a4a3b982d5 /src/Compositor.cpp | |
| parent | 338865e4334b5c60ba2657ff6ab7a069b8d7e19d (diff) | |
added general:no_cursor_warps
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 16 |
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); +} + |
