summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2026-03-03 13:03:47 +0000
committerGitHub <noreply@github.com>2026-03-03 13:03:47 +0000
commit7299a3b0d5332da030e980e60b0ee35b93387cff (patch)
tree5f59a47fab260956037e89c39b04cc84dff44cb1
parentb06a4b5e130710ee66d0a9b04780d99777d87b47 (diff)
hyprctl: fix workspace dynamic effect reloading (#13537)
ref https://github.com/hyprwm/Hyprland/discussions/12806
-rw-r--r--hyprtester/src/tests/main/workspaces.cpp20
-rw-r--r--src/debug/HyprCtl.cpp9
-rw-r--r--src/desktop/rule/windowRule/WindowRuleApplicator.cpp2
-rw-r--r--src/desktop/view/Window.cpp14
-rw-r--r--src/layout/target/WindowTarget.cpp1
5 files changed, 37 insertions, 9 deletions
diff --git a/hyprtester/src/tests/main/workspaces.cpp b/hyprtester/src/tests/main/workspaces.cpp
index ff023ccf..122cd619 100644
--- a/hyprtester/src/tests/main/workspaces.cpp
+++ b/hyprtester/src/tests/main/workspaces.cpp
@@ -375,6 +375,24 @@ static void testMultimonFocus() {
Tests::killAllWindows();
}
+static void testDynamicWsEffects() {
+ // test dynamic workspace effects, they shouldn't lag
+
+ OK(getFromSocket("/dispatch workspace 69"));
+
+ Tests::spawnKitty("bitch");
+
+ OK(getFromSocket("r/keyword workspace 69,bordersize:20"));
+ OK(getFromSocket("r/keyword workspace 69,rounding:false"));
+
+ EXPECT(getFromSocket("/getprop class:bitch border_size"), "20");
+ EXPECT(getFromSocket("/getprop class:bitch rounding"), "0");
+
+ OK(getFromSocket("/reload"));
+
+ Tests::killAllWindows();
+}
+
static bool test() {
NLog::log("{}Testing workspaces", Colors::GREEN);
@@ -720,8 +738,8 @@ static bool test() {
OK(getFromSocket("/output remove HEADLESS-3"));
testSpecialWorkspaceFullscreen();
-
testAsymmetricGaps();
+ testDynamicWsEffects();
NLog::log("{}Expecting 0 windows", Colors::YELLOW);
EXPECT(Tests::windowCount(), 0);
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp
index 1fcb3dd1..417767e1 100644
--- a/src/debug/HyprCtl.cpp
+++ b/src/debug/HyprCtl.cpp
@@ -2197,6 +2197,15 @@ std::string CHyprCtl::getReply(std::string request) {
Desktop::Rule::ruleEngine()->updateAllRules();
}
+ for (const auto& ws : g_pCompositor->getWorkspaces()) {
+ if (!ws)
+ continue;
+
+ ws->updateWindows();
+ ws->updateWindowData();
+ ws->updateWindowDecos();
+ }
+
for (auto const& m : g_pCompositor->m_monitors) {
g_pHyprRenderer->damageMonitor(m);
}
diff --git a/src/desktop/rule/windowRule/WindowRuleApplicator.cpp b/src/desktop/rule/windowRule/WindowRuleApplicator.cpp
index 45a52471..07cb5f64 100644
--- a/src/desktop/rule/windowRule/WindowRuleApplicator.cpp
+++ b/src/desktop/rule/windowRule/WindowRuleApplicator.cpp
@@ -630,6 +630,8 @@ void CWindowRuleApplicator::propertiesChanged(std::underlying_type_t<eRuleProper
needsRelayout = needsRelayout || RES.needsRelayout;
}
+ m_window->updateWindowData();
+ m_window->updateWindowDecos();
m_window->updateDecorationValues();
if (needsRelayout)
diff --git a/src/desktop/view/Window.cpp b/src/desktop/view/Window.cpp
index 5871456b..77c5f330 100644
--- a/src/desktop/view/Window.cpp
+++ b/src/desktop/view/Window.cpp
@@ -510,12 +510,6 @@ void CWindow::moveToWorkspace(PHLWORKSPACE pWorkspace) {
setAnimationsToMove();
- OLDWORKSPACE->updateWindows();
- OLDWORKSPACE->updateWindowData();
-
- pWorkspace->updateWindows();
- pWorkspace->updateWindowData();
-
g_pCompositor->updateAllWindowsAnimatedDecorationValues();
if (valid(pWorkspace)) {
@@ -807,9 +801,13 @@ void CWindow::updateWindowData() {
}
void CWindow::updateWindowData(const SWorkspaceRule& workspaceRule) {
- m_ruleApplicator->borderSize().matchOptional(workspaceRule.borderSize, Desktop::Types::PRIORITY_WORKSPACE_RULE);
+ if (workspaceRule.noBorder.value_or(false))
+ m_ruleApplicator->borderSize().matchOptional(std::optional<Hyprlang::INT>(0), Desktop::Types::PRIORITY_WORKSPACE_RULE);
+ else if (workspaceRule.borderSize)
+ m_ruleApplicator->borderSize().matchOptional(workspaceRule.borderSize, Desktop::Types::PRIORITY_WORKSPACE_RULE);
+ else
+ m_ruleApplicator->borderSize().matchOptional(std::nullopt, Desktop::Types::PRIORITY_WORKSPACE_RULE);
m_ruleApplicator->decorate().matchOptional(workspaceRule.decorate, Desktop::Types::PRIORITY_WORKSPACE_RULE);
- m_ruleApplicator->borderSize().matchOptional(workspaceRule.noBorder ? std::optional<Hyprlang::INT>(0) : std::nullopt, Desktop::Types::PRIORITY_WORKSPACE_RULE);
m_ruleApplicator->rounding().matchOptional(workspaceRule.noRounding.value_or(false) ? std::optional<Hyprlang::INT>(0) : std::nullopt, Desktop::Types::PRIORITY_WORKSPACE_RULE);
m_ruleApplicator->noShadow().matchOptional(workspaceRule.noShadow, Desktop::Types::PRIORITY_WORKSPACE_RULE);
}
diff --git a/src/layout/target/WindowTarget.cpp b/src/layout/target/WindowTarget.cpp
index ec4efb03..db03a385 100644
--- a/src/layout/target/WindowTarget.cpp
+++ b/src/layout/target/WindowTarget.cpp
@@ -377,5 +377,6 @@ void CWindowTarget::onUpdateSpace() {
m_window->m_monitor = space()->workspace()->m_monitor;
m_window->moveToWorkspace(space()->workspace());
m_window->updateToplevel();
+ m_window->updateWindowData();
m_window->updateWindowDecos();
}