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:
Pavel Belyavsky
2024-12-10 23:55:05 +03:00
committed by GitHub
parent c16044a5c8
commit 4d05677e8d
4 changed files with 9 additions and 9 deletions

View File

@@ -1202,12 +1202,12 @@ SDispatchResult CKeybindManager::changeworkspace(std::string args) {
const static auto PWARPONWORKSPACECHANGE = CConfigValue<Hyprlang::INT>("cursor:warp_on_change_workspace");
if (*PWARPONWORKSPACECHANGE) {
if (*PWARPONWORKSPACECHANGE > 0) {
auto PLAST = pWorkspaceToChangeTo->getLastFocusedWindow();
auto HLSurface = CWLSurface::fromResource(g_pSeatManager->state.pointerFocus.lock());
if (PLAST && (!HLSurface || HLSurface->getWindow()))
PLAST->warpCursor();
PLAST->warpCursor(*PWARPONWORKSPACECHANGE == 2);
}
return {};