mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-07-31 04:01:56 -07:00
recalculate layout only when needed on dynamic keywords
This commit is contained in:
@@ -983,6 +983,8 @@ std::string CConfigManager::parseKeyword(const std::string& COMMAND, const std::
|
|||||||
currentCategory = "";
|
currentCategory = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int needsLayoutRecalc = COMMAND == "monitor"; // 0 - no, 1 - yes, 2 - maybe
|
||||||
|
|
||||||
if (COMMAND == "exec") {
|
if (COMMAND == "exec") {
|
||||||
if (isFirstLaunch) {
|
if (isFirstLaunch) {
|
||||||
firstExecRequests.push_back(VALUE);
|
firstExecRequests.push_back(VALUE);
|
||||||
@@ -1006,16 +1008,22 @@ std::string CConfigManager::parseKeyword(const std::string& COMMAND, const std::
|
|||||||
else if (COMMAND == "submap") handleSubmap(COMMAND, VALUE);
|
else if (COMMAND == "submap") handleSubmap(COMMAND, VALUE);
|
||||||
else if (COMMAND == "blurls") handleBlurLS(COMMAND, VALUE);
|
else if (COMMAND == "blurls") handleBlurLS(COMMAND, VALUE);
|
||||||
else if (COMMAND == "wsbind") handleBindWS(COMMAND, VALUE);
|
else if (COMMAND == "wsbind") handleBindWS(COMMAND, VALUE);
|
||||||
else
|
else {
|
||||||
configSetValueSafe(currentCategory + (currentCategory == "" ? "" : ":") + COMMAND, VALUE);
|
configSetValueSafe(currentCategory + (currentCategory == "" ? "" : ":") + COMMAND, VALUE);
|
||||||
|
needsLayoutRecalc = 2;
|
||||||
|
}
|
||||||
|
|
||||||
if (dynamic) {
|
if (dynamic) {
|
||||||
std::string retval = parseError;
|
std::string retval = parseError;
|
||||||
parseError = "";
|
parseError = "";
|
||||||
|
|
||||||
// invalidate layouts jic
|
// invalidate layouts if they changed
|
||||||
for (auto& m : g_pCompositor->m_vMonitors)
|
if (needsLayoutRecalc) {
|
||||||
g_pLayoutManager->getCurrentLayout()->recalculateMonitor(m->ID);
|
if (needsLayoutRecalc == 1 || VALUE.find("gaps_") || VALUE.find("dwindle:") == 0 || VALUE.find("master:") == 0) {
|
||||||
|
for (auto& m : g_pCompositor->m_vMonitors)
|
||||||
|
g_pLayoutManager->getCurrentLayout()->recalculateMonitor(m->ID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Update window border colors
|
// Update window border colors
|
||||||
g_pCompositor->updateAllWindowsAnimatedDecorationValues();
|
g_pCompositor->updateAllWindowsAnimatedDecorationValues();
|
||||||
|
Reference in New Issue
Block a user