input: add warp_on_toggle_special (#9945)
This commit is contained in:
parent
0dc531c4a7
commit
d775686380
3 changed files with 26 additions and 0 deletions
|
|
@ -2097,10 +2097,16 @@ SDispatchResult CKeybindManager::toggleSpecialWorkspace(std::string args) {
|
|||
}
|
||||
}
|
||||
|
||||
updateRelativeCursorCoords();
|
||||
|
||||
PHLWORKSPACEREF focusedWorkspace;
|
||||
|
||||
if (requestedWorkspaceIsAlreadyOpen && specialOpenOnMonitor == workspaceID) {
|
||||
// already open on this monitor
|
||||
Debug::log(LOG, "Toggling special workspace {} to closed", workspaceID);
|
||||
PMONITOR->setSpecialWorkspace(nullptr);
|
||||
|
||||
focusedWorkspace = PMONITOR->activeWorkspace;
|
||||
} else {
|
||||
Debug::log(LOG, "Toggling special workspace {} to open", workspaceID);
|
||||
auto PSPECIALWORKSPACE = g_pCompositor->getWorkspaceByID(workspaceID);
|
||||
|
|
@ -2109,6 +2115,18 @@ SDispatchResult CKeybindManager::toggleSpecialWorkspace(std::string args) {
|
|||
PSPECIALWORKSPACE = g_pCompositor->createNewWorkspace(workspaceID, PMONITOR->ID, workspaceName);
|
||||
|
||||
PMONITOR->setSpecialWorkspace(PSPECIALWORKSPACE);
|
||||
|
||||
focusedWorkspace = PSPECIALWORKSPACE;
|
||||
}
|
||||
|
||||
const static auto PWARPONTOGGLESPECIAL = CConfigValue<Hyprlang::INT>("cursor:warp_on_toggle_special");
|
||||
|
||||
if (*PWARPONTOGGLESPECIAL > 0) {
|
||||
auto PLAST = focusedWorkspace->getLastFocusedWindow();
|
||||
auto HLSurface = CWLSurface::fromResource(g_pSeatManager->state.pointerFocus.lock());
|
||||
|
||||
if (PLAST && (!HLSurface || HLSurface->getWindow()))
|
||||
PLAST->warpCursor(*PWARPONTOGGLESPECIAL == 2);
|
||||
}
|
||||
|
||||
return {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue