aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/config
diff options
context:
space:
mode:
authorIkalco <[email protected]>2024-08-12 11:16:00 -0500
committerGitHub <[email protected]>2024-08-12 17:16:00 +0100
commitd361fcbd85a92f0494c6d8ef0c63aad798df20a7 (patch)
treeb88270dbd5ffa97da9ae0b5efec20a6a2ea9c5da /src/config
parentdf9d830117cbbf8a1b2a144a28261c28753cb022 (diff)
downloadHyprland-d361fcbd85a92f0494c6d8ef0c63aad798df20a7.tar.gz
Hyprland-d361fcbd85a92f0494c6d8ef0c63aad798df20a7.zip
config: fix explicit sync option warning (#7293)
Diffstat (limited to 'src/config')
-rw-r--r--src/config/ConfigManager.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index edc1723d..41d3871c 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -822,9 +822,6 @@ void CConfigManager::postConfigReload(const Hyprlang::CParseResult& result) {
if (!isFirstLaunch)
g_pHyprOpenGL->m_bReloadScreenShader = true;
- if (!isFirstLaunch && *PENABLEEXPLICIT != prevEnabledExplicit)
- g_pHyprError->queueCreate("Warning: You changed the render:explicit_sync option, this requires you to restart Hyprland.", CColor(0.9, 0.76, 0.221, 1.0));
-
// parseError will be displayed next frame
if (result.error)
@@ -837,6 +834,8 @@ void CConfigManager::postConfigReload(const Hyprlang::CParseResult& result) {
else if (std::any_cast<Hyprlang::INT>(m_pConfig->getConfigValue("autogenerated")) == 1)
g_pHyprError->queueCreate("Warning: You're using an autogenerated config! (config file: " + getMainConfigPath() + " )\nSUPER+Q -> kitty\nSUPER+M -> exit Hyprland",
CColor(1.0, 1.0, 70.0 / 255.0, 1.0));
+ else if (*PENABLEEXPLICIT != prevEnabledExplicit)
+ g_pHyprError->queueCreate("Warning: You changed the render:explicit_sync option, this requires you to restart Hyprland.", CColor(0.9, 0.76, 0.221, 1.0));
else
g_pHyprError->destroy();
@@ -925,7 +924,10 @@ void CConfigManager::init() {
}
std::string CConfigManager::parseKeyword(const std::string& COMMAND, const std::string& VALUE) {
- const auto RET = m_pConfig->parseDynamic(COMMAND.c_str(), VALUE.c_str());
+ static const auto PENABLEEXPLICIT = CConfigValue<Hyprlang::INT>("render:explicit_sync");
+ static int prevEnabledExplicit = *PENABLEEXPLICIT;
+
+ const auto RET = m_pConfig->parseDynamic(COMMAND.c_str(), VALUE.c_str());
// invalidate layouts if they changed
if (COMMAND == "monitor" || COMMAND.contains("gaps_") || COMMAND.starts_with("dwindle:") || COMMAND.starts_with("master:")) {
@@ -933,6 +935,13 @@ std::string CConfigManager::parseKeyword(const std::string& COMMAND, const std::
g_pLayoutManager->getCurrentLayout()->recalculateMonitor(m->ID);
}
+ if (COMMAND.contains("explicit")) {
+ if (*PENABLEEXPLICIT != prevEnabledExplicit)
+ g_pHyprError->queueCreate("Warning: You changed the render:explicit_sync option, this requires you to restart Hyprland.", CColor(0.9, 0.76, 0.221, 1.0));
+ else
+ g_pHyprError->destroy();
+ }
+
// Update window border colors
g_pCompositor->updateAllWindowsAnimatedDecorationValues();