mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 06:45:59 +01:00
possible crash when current workspace does not exist (#1023)
Co-authored-by: Jef Steelant <jef.steelant_ext@softathome.com>
This commit is contained in:
parent
fcb5037a1d
commit
4034aa2c60
1 changed files with 2 additions and 2 deletions
|
@ -680,7 +680,7 @@ void CKeybindManager::changeworkspace(std::string args) {
|
||||||
const auto PCURRENTWORKSPACE = g_pCompositor->getWorkspaceByID(g_pCompositor->m_pLastMonitor->activeWorkspace);
|
const auto PCURRENTWORKSPACE = g_pCompositor->getWorkspaceByID(g_pCompositor->m_pLastMonitor->activeWorkspace);
|
||||||
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 && 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);
|
||||||
|
|
||||||
|
@ -699,7 +699,7 @@ void CKeybindManager::changeworkspace(std::string args) {
|
||||||
if (!*PALLOWWORKSPACECYCLES)
|
if (!*PALLOWWORKSPACECYCLES)
|
||||||
PCURRENTWORKSPACE->m_iPrevWorkspaceID = -1;
|
PCURRENTWORKSPACE->m_iPrevWorkspaceID = -1;
|
||||||
|
|
||||||
} else if (PCURRENTWORKSPACE->m_iID == workspaceToChangeTo && !internal)
|
} else if (PCURRENTWORKSPACE && PCURRENTWORKSPACE->m_iID == workspaceToChangeTo && !internal)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// remove constraints
|
// remove constraints
|
||||||
|
|
Loading…
Reference in a new issue