mirror of
https://github.com/hyprwm/Hyprland
synced 2025-02-17 00:42:11 +01:00
fix workspace previous with multi-mon ws moves
This commit is contained in:
parent
f901c60da5
commit
9480c0fb90
1 changed files with 11 additions and 9 deletions
|
@ -643,16 +643,18 @@ void CKeybindManager::changeworkspace(std::string args) {
|
||||||
static auto *const PBACKANDFORTH = &g_pConfigManager->getConfigValuePtr("binds:workspace_back_and_forth")->intValue;
|
static auto *const PBACKANDFORTH = &g_pConfigManager->getConfigValuePtr("binds:workspace_back_and_forth")->intValue;
|
||||||
|
|
||||||
if (*PBACKANDFORTH && PCURRENTWORKSPACE->m_iID == workspaceToChangeTo && PCURRENTWORKSPACE->m_iPrevWorkspaceID != -1 && !internal) {
|
if (*PBACKANDFORTH && PCURRENTWORKSPACE->m_iID == workspaceToChangeTo && PCURRENTWORKSPACE->m_iPrevWorkspaceID != -1 && !internal) {
|
||||||
|
|
||||||
|
const auto PPREVWORKSPACE = g_pCompositor->getWorkspaceByID(PCURRENTWORKSPACE->m_iPrevWorkspaceID);
|
||||||
|
if (!PPREVWORKSPACE || PPREVWORKSPACE->m_iMonitorID == PCURRENTWORKSPACE->m_iMonitorID) {
|
||||||
|
workspaceToChangeTo = PCURRENTWORKSPACE->m_iPrevWorkspaceID;
|
||||||
|
isSwitchingToPrevious = true;
|
||||||
|
|
||||||
workspaceToChangeTo = PCURRENTWORKSPACE->m_iPrevWorkspaceID;
|
// If the previous workspace ID isn't reset, cycles can form when continually going
|
||||||
isSwitchingToPrevious = true;
|
// to the previous workspace again and again.
|
||||||
|
static auto* const PALLOWWORKSPACECYCLES = &g_pConfigManager->getConfigValuePtr("binds:allow_workspace_cycles")->intValue;
|
||||||
// If the previous workspace ID isn't reset, cycles can form when continually going
|
if (!*PALLOWWORKSPACECYCLES)
|
||||||
// to the previous workspace again and again.
|
PCURRENTWORKSPACE->m_iPrevWorkspaceID = -1;
|
||||||
static auto *const PALLOWWORKSPACECYCLES = &g_pConfigManager->getConfigValuePtr("binds:allow_workspace_cycles")->intValue;
|
}
|
||||||
if (!*PALLOWWORKSPACECYCLES)
|
|
||||||
PCURRENTWORKSPACE->m_iPrevWorkspaceID = -1;
|
|
||||||
|
|
||||||
} else if (PCURRENTWORKSPACE->m_iID == workspaceToChangeTo && !internal)
|
} else if (PCURRENTWORKSPACE->m_iID == workspaceToChangeTo && !internal)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue