mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-10 08:05:58 +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)
|
if (!PWINDOW->m_bIsFloating || PWINDOW->m_bIsFullscreen)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PWINDOW->m_bPinned = !PWINDOW->m_bPinned;
|
PWINDOW->m_bPinned = !PWINDOW->m_bPinned;
|
||||||
PWINDOW->m_pWorkspace = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID)->activeWorkspace;
|
|
||||||
|
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();
|
PWINDOW->updateDynamicRules();
|
||||||
g_pCompositor->updateWindowAnimatedDecorationValues(PWINDOW);
|
g_pCompositor->updateWindowAnimatedDecorationValues(PWINDOW);
|
||||||
|
|
Loading…
Reference in a new issue