hyprctl: fix layerrules not being applied dynamically with hyprctl (#13080)

This commit is contained in:
ItsOhen 2026-01-27 13:13:29 +01:00 committed by GitHub
parent 21325f9385
commit bcb34275ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1296,8 +1296,13 @@ static std::string dispatchKeyword(eHyprCtlOutputFormat format, std::string in)
g_pHyprCtl->m_currentRequestParams.isDynamicKeyword = false;
if (COMMAND == "source") {
g_pConfigManager->m_wantsMonitorReload = true;
g_pEventLoopManager->doLater([] { g_pConfigManager->reloadRules(); });
}
// if we are executing a dynamic source we have to reload everything, so every if will have a check for source.
if (COMMAND == "monitor" || COMMAND == "source")
if (COMMAND == "monitor")
g_pConfigManager->m_wantsMonitorReload = true; // for monitor keywords
if (COMMAND.contains("monitorv2"))
@ -1340,6 +1345,14 @@ static std::string dispatchKeyword(eHyprCtlOutputFormat format, std::string in)
if (COMMAND.contains("windowrule ") || COMMAND.contains("windowrule["))
g_pConfigManager->reloadRules();
if (COMMAND.contains("layerrule") || COMMAND.contains("layerrule[")) {
g_pConfigManager->reloadRules();
// Damage all monitors to redraw static layers.
for (auto const& m : g_pCompositor->m_monitors) {
g_pHyprRenderer->damageMonitor(m);
}
}
if (COMMAND.contains("workspace"))
g_pConfigManager->ensurePersistentWorkspacesPresent();