mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 06:45:59 +01:00
guard header windows in layout messages
This commit is contained in:
parent
748a6965ca
commit
349afa0e7a
1 changed files with 13 additions and 0 deletions
|
@ -544,6 +544,9 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri
|
||||||
if (message == "swapwithmaster") {
|
if (message == "swapwithmaster") {
|
||||||
const auto PWINDOW = header.pWindow;
|
const auto PWINDOW = header.pWindow;
|
||||||
|
|
||||||
|
if (!PWINDOW)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (!isWindowTiled(PWINDOW))
|
if (!isWindowTiled(PWINDOW))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -559,6 +562,10 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri
|
||||||
return 0;
|
return 0;
|
||||||
} else if (message == "focusmaster") {
|
} else if (message == "focusmaster") {
|
||||||
const auto PWINDOW = header.pWindow;
|
const auto PWINDOW = header.pWindow;
|
||||||
|
|
||||||
|
if (!PWINDOW)
|
||||||
|
return 0;
|
||||||
|
|
||||||
const auto PMASTER = getMasterNodeOnWorkspace(PWINDOW->m_iWorkspaceID);
|
const auto PMASTER = getMasterNodeOnWorkspace(PWINDOW->m_iWorkspaceID);
|
||||||
|
|
||||||
if (!PMASTER || PMASTER->pWindow == PWINDOW)
|
if (!PMASTER || PMASTER->pWindow == PWINDOW)
|
||||||
|
@ -570,10 +577,16 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri
|
||||||
} else if (message == "cyclenext") {
|
} else if (message == "cyclenext") {
|
||||||
const auto PWINDOW = header.pWindow;
|
const auto PWINDOW = header.pWindow;
|
||||||
|
|
||||||
|
if (!PWINDOW)
|
||||||
|
return 0;
|
||||||
|
|
||||||
switchToWindow(getNextWindow(PWINDOW, true));
|
switchToWindow(getNextWindow(PWINDOW, true));
|
||||||
} else if (message == "cycleprev") {
|
} else if (message == "cycleprev") {
|
||||||
const auto PWINDOW = header.pWindow;
|
const auto PWINDOW = header.pWindow;
|
||||||
|
|
||||||
|
if (!PWINDOW)
|
||||||
|
return 0;
|
||||||
|
|
||||||
switchToWindow(getNextWindow(PWINDOW, false));
|
switchToWindow(getNextWindow(PWINDOW, false));
|
||||||
} else if (message == "swapnext") {
|
} else if (message == "swapnext") {
|
||||||
if (!g_pCompositor->windowValidMapped(header.pWindow))
|
if (!g_pCompositor->windowValidMapped(header.pWindow))
|
||||||
|
|
Loading…
Reference in a new issue