mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 15:05:59 +01:00
keybinds: handle null monitor in pinActive (#7122)
This commit is contained in:
parent
3b9b5346b8
commit
8a5f9bbb39
1 changed files with 10 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue