Skip to content

Commit

Permalink
config/hyprctl: fix keyword not updating autoreload
Browse files Browse the repository at this point in the history
ref #9139
  • Loading branch information
vaxerski committed Jan 29, 2025
1 parent 344e32d commit aaa5573
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/config/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions src/config/ConfigManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ class CConfigManager {
void ensureVRR(PHLMONITOR pMonitor = nullptr);

bool shouldUseSoftwareCursors();
void updateWatcher();

std::string parseKeyword(const std::string&, const std::string&);

Expand Down
3 changes: 3 additions & 0 deletions src/debug/HyprCtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down

0 comments on commit aaa5573

Please sign in to comment.