From 61b950d942077e26e5f68c164bca9ea7e35e3017 Mon Sep 17 00:00:00 2001 From: abbadanor <69853409+abbadanor@users.noreply.github.com> Date: Wed, 2 Nov 2022 11:15:11 +0100 Subject: [PATCH] Add focusmaster dispatcher (#942) * added focusmaster dispatcher * format Co-authored-by: Adam Nord Co-authored-by: vaxerski <43317083+vaxerski@users.noreply.github.com> --- src/layout/MasterLayout.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp index d2577577..6021fac2 100644 --- a/src/layout/MasterLayout.cpp +++ b/src/layout/MasterLayout.cpp @@ -542,7 +542,6 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri }; if (message == "swapwithmaster") { - const auto PWINDOW = header.pWindow; if (!isWindowTiled(PWINDOW)) @@ -557,6 +556,16 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri 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; } else if (message == "cyclenext") { const auto PWINDOW = header.pWindow;