mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-29 23:06:00 +01:00
fix naming when workspace back and forth
This commit is contained in:
parent
9480c0fb90
commit
b4a8efc1a7
1 changed files with 17 additions and 11 deletions
|
@ -645,16 +645,22 @@ void CKeybindManager::changeworkspace(std::string args) {
|
||||||
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);
|
const auto PPREVWORKSPACE = g_pCompositor->getWorkspaceByID(PCURRENTWORKSPACE->m_iPrevWorkspaceID);
|
||||||
if (!PPREVWORKSPACE || PPREVWORKSPACE->m_iMonitorID == PCURRENTWORKSPACE->m_iMonitorID) {
|
|
||||||
workspaceToChangeTo = PCURRENTWORKSPACE->m_iPrevWorkspaceID;
|
|
||||||
isSwitchingToPrevious = true;
|
|
||||||
|
|
||||||
// If the previous workspace ID isn't reset, cycles can form when continually going
|
workspaceToChangeTo = PCURRENTWORKSPACE->m_iPrevWorkspaceID;
|
||||||
// to the previous workspace again and again.
|
|
||||||
static auto* const PALLOWWORKSPACECYCLES = &g_pConfigManager->getConfigValuePtr("binds:allow_workspace_cycles")->intValue;
|
if (PPREVWORKSPACE)
|
||||||
if (!*PALLOWWORKSPACECYCLES)
|
workspaceName = PPREVWORKSPACE->m_szName;
|
||||||
PCURRENTWORKSPACE->m_iPrevWorkspaceID = -1;
|
else
|
||||||
}
|
workspaceName = std::to_string(workspaceToChangeTo);
|
||||||
|
|
||||||
|
isSwitchingToPrevious = true;
|
||||||
|
|
||||||
|
// If the previous workspace ID isn't reset, cycles can form when continually going
|
||||||
|
// to the previous workspace again and again.
|
||||||
|
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…
Reference in a new issue