mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-10 00:51:58 -07:00
config: add 'force' option for 'cursor:warp_on_change_workspace' (#8681)
* config: add 'force' option for 'cursor:warp_on_change_workspace' * manager: throw the expression into the function arguments * config: fix description of `cursor:warp_on_change_workspace`
This commit is contained in:
@@ -1529,15 +1529,15 @@ void CWindow::onX11Configure(CBox box) {
|
||||
g_pHyprRenderer->damageWindow(m_pSelf.lock());
|
||||
}
|
||||
|
||||
void CWindow::warpCursor() {
|
||||
void CWindow::warpCursor(bool force) {
|
||||
static auto PERSISTENTWARPS = CConfigValue<Hyprlang::INT>("cursor:persistent_warps");
|
||||
const auto coords = m_vRelativeCursorCoordsOnLastWarp;
|
||||
m_vRelativeCursorCoordsOnLastWarp.x = -1; // reset m_vRelativeCursorCoordsOnLastWarp
|
||||
|
||||
if (*PERSISTENTWARPS && coords.x > 0 && coords.y > 0 && coords < m_vSize) // don't warp cursor outside the window
|
||||
g_pCompositor->warpCursorTo(m_vPosition + coords);
|
||||
g_pCompositor->warpCursorTo(m_vPosition + coords, force);
|
||||
else
|
||||
g_pCompositor->warpCursorTo(middle());
|
||||
g_pCompositor->warpCursorTo(middle(), force);
|
||||
}
|
||||
|
||||
PHLWINDOW CWindow::getSwallower() {
|
||||
|
Reference in New Issue
Block a user