diff options
author | André Silva <[email protected]> | 2024-07-31 16:54:07 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2024-07-31 17:54:07 +0200 |
commit | 8a5f9bbb394ddeb4be9a9df6248b41b07d84ea66 (patch) | |
tree | 489540eaa25b76c7d6a25ca85d97daf0aaf5d1cb | |
parent | 3b9b5346b830554aa7470ccf1202a7f3be72d1b4 (diff) | |
download | Hyprland-8a5f9bbb394ddeb4be9a9df6248b41b07d84ea66.tar.gz Hyprland-8a5f9bbb394ddeb4be9a9df6248b41b07d84ea66.zip |
keybinds: handle null monitor in pinActive (#7122)
-rw-r--r-- | src/managers/KeybindManager.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 2b99ce97..823e2d2e 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -2333,8 +2333,16 @@ void CKeybindManager::pinActive(std::string args) { if (!PWINDOW->m_bIsFloating || PWINDOW->m_bIsFullscreen) return; - PWINDOW->m_bPinned = !PWINDOW->m_bPinned; - PWINDOW->m_pWorkspace = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID)->activeWorkspace; + PWINDOW->m_bPinned = !PWINDOW->m_bPinned; + + const auto PMONITOR = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID); + + if (!PMONITOR) { + Debug::log(ERR, "pin: monitor not found"); + return; + } + + PWINDOW->m_pWorkspace = PMONITOR->activeWorkspace; PWINDOW->updateDynamicRules(); g_pCompositor->updateWindowAnimatedDecorationValues(PWINDOW); |