mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 15:45:59 +01:00
fix bug which allowed a switch to workspace ID -1.
This only happened for the workspace_back_and_forth setting, since it was missing a check.
This commit is contained in:
parent
3c8c605541
commit
6ec932d11f
1 changed files with 5 additions and 4 deletions
|
@ -493,11 +493,12 @@ void CKeybindManager::changeworkspace(std::string args) {
|
|||
|
||||
// Workspace_back_and_forth being enabled means that an attempt to switch to
|
||||
// the current workspace will instead switch to the previous.
|
||||
const auto PCURRENTWORKSPACE = g_pCompositor->getWorkspaceByID(
|
||||
g_pCompositor->m_pLastMonitor->activeWorkspace);
|
||||
static auto *const PBACKANDFORTH = &g_pConfigManager->getConfigValuePtr("binds:workspace_back_and_forth")->intValue;
|
||||
if (*PBACKANDFORTH && g_pCompositor->m_pLastMonitor->activeWorkspace == workspaceToChangeTo) {
|
||||
|
||||
const auto PCURRENTWORKSPACE = g_pCompositor->getWorkspaceByID(
|
||||
g_pCompositor->m_pLastMonitor->activeWorkspace);
|
||||
if (*PBACKANDFORTH
|
||||
&& PCURRENTWORKSPACE->m_iID == workspaceToChangeTo
|
||||
&& PCURRENTWORKSPACE->m_iPrevWorkspaceID != -1) {
|
||||
|
||||
workspaceToChangeTo = PCURRENTWORKSPACE->m_iPrevWorkspaceID;
|
||||
isSwitchingToPrevious = true;
|
||||
|
|
Loading…
Reference in a new issue