Skip to content

Commit

Permalink
master: change the mfact dispatcher to use splitratio (#4766)
Browse files Browse the repository at this point in the history
* master layout: change the mfact dispatcher to use splitratio

* add space for concat
  • Loading branch information
thejch committed Apr 13, 2024
1 parent 0c513ba commit 34396f5
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/layout/MasterLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1285,19 +1285,7 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri
} else if (command == "orientationcycle") {
runOrientationCycle(header, &vars, 1);
} else if (command == "mfact") {
if (vars.size() >= 2) {
float newMfact = 0;
try {
newMfact = std::stof(vars[1]);
} catch (std::exception& e) {
Debug::log(ERR, "Argument is invalid: {}", e.what());
return 0;
}
for (auto& nd : m_lMasterNodesData) {
if (nd.isMaster)
nd.percMaster = std::clamp(newMfact, 0.05f, 0.95f);
}
}
g_pKeybindManager->m_mDispatchers["splitratio"](vars[1] + " " + vars[2]);
} else if (command == "rollnext") {
const auto PWINDOW = header.pWindow;
const auto PNODE = getNodeFromWindow(PWINDOW);
Expand Down

0 comments on commit 34396f5

Please sign in to comment.