Add focusmaster dispatcher (#942)

* added focusmaster dispatcher

* format

Co-authored-by: Adam Nord <adam.nord@abbgymnasiet.se>
Co-authored-by: vaxerski <43317083+vaxerski@users.noreply.github.com>
This commit is contained in:
abbadanor 2022-11-02 11:15:11 +01:00 committed by GitHub
parent a16073a87b
commit 61b950d942
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -542,7 +542,6 @@ 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 (!isWindowTiled(PWINDOW)) if (!isWindowTiled(PWINDOW))
@ -557,6 +556,16 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri
switchToWindow(PWINDOW); switchToWindow(PWINDOW);
return 0;
} else if (message == "focusmaster") {
const auto PWINDOW = header.pWindow;
const auto PMASTER = getMasterNodeOnWorkspace(PWINDOW->m_iWorkspaceID);
if (!PMASTER || PMASTER->pWindow == PWINDOW)
return 0;
switchToWindow(PMASTER->pWindow);
return 0; return 0;
} else if (message == "cyclenext") { } else if (message == "cyclenext") {
const auto PWINDOW = header.pWindow; const auto PWINDOW = header.pWindow;