summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvaxerski <vaxry@vaxry.net>2025-01-29 10:50:39 +0000
committervaxerski <vaxry@vaxry.net>2025-01-29 10:50:39 +0000
commitaaa5573c73636a76dd3ae4758bfd89ae4d5eeb8a (patch)
treed93b69d8c21bfa2d3215a34f250efaf12ce9294c
parent344e32d71bf115a32434da3fa72b2b6238706625 (diff)
config/hyprctl: fix keyword not updating autoreload
ref #9139
-rw-r--r--src/config/ConfigManager.cpp8
-rw-r--r--src/config/ConfigManager.hpp1
-rw-r--r--src/debug/HyprCtl.cpp3
3 files changed, 10 insertions, 2 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index daff9285..047c58d9 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -912,12 +912,16 @@ std::optional<std::string> CConfigManager::resetHLConfig() {
return RET;
}
+void CConfigManager::updateWatcher() {
+ static const auto PDISABLEAUTORELOAD = CConfigValue<Hyprlang::INT>("misc:disable_autoreload");
+ g_pConfigWatcher->setWatchList(*PDISABLEAUTORELOAD ? std::vector<std::string>{} : m_configPaths);
+}
+
void CConfigManager::postConfigReload(const Hyprlang::CParseResult& result) {
static const auto PENABLEEXPLICIT = CConfigValue<Hyprlang::INT>("render:explicit_sync");
- static const auto PDISABLEAUTORELOAD = CConfigValue<Hyprlang::INT>("misc:disable_autoreload");
static int prevEnabledExplicit = *PENABLEEXPLICIT;
- g_pConfigWatcher->setWatchList(*PDISABLEAUTORELOAD ? std::vector<std::string>{} : m_configPaths);
+ updateWatcher();
for (auto const& w : g_pCompositor->m_vWindows) {
w->uncacheWindowDecos();
diff --git a/src/config/ConfigManager.hpp b/src/config/ConfigManager.hpp
index ae0ba759..f0696882 100644
--- a/src/config/ConfigManager.hpp
+++ b/src/config/ConfigManager.hpp
@@ -190,6 +190,7 @@ class CConfigManager {
void ensureVRR(PHLMONITOR pMonitor = nullptr);
bool shouldUseSoftwareCursors();
+ void updateWatcher();
std::string parseKeyword(const std::string&, const std::string&);
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp
index cfdba100..359428b1 100644
--- a/src/debug/HyprCtl.cpp
+++ b/src/debug/HyprCtl.cpp
@@ -1100,6 +1100,9 @@ static std::string dispatchKeyword(eHyprCtlOutputFormat format, std::string in)
}
}
+ if (COMMAND.contains("misc:disable_autoreload"))
+ g_pConfigManager->updateWatcher();
+
// decorations will probably need a repaint
if (COMMAND.contains("decoration:") || COMMAND.contains("border") || COMMAND == "workspace" || COMMAND.contains("zoom_factor") || COMMAND == "source" ||
COMMAND.starts_with("windowrule")) {