summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordavc0n <dconti.dev@gmail.com>2025-04-20 20:39:33 +0200
committerGitHub <noreply@github.com>2025-04-20 20:39:33 +0200
commit4d14bcb02f54b1ab35ccf909e461c8e7646a38e2 (patch)
tree00852b053347e24e5897d4ad754e2f9c6fd82e99 /src
parent9b4060f09be06250e859b27d6dd3ded5349f5546 (diff)
config: Refactor class member vars (#10124)
* Refactor config classes vars * Fix clang format errors
Diffstat (limited to 'src')
-rw-r--r--src/Compositor.cpp4
-rw-r--r--src/config/ConfigDataValues.hpp64
-rw-r--r--src/config/ConfigManager.cpp454
-rw-r--r--src/config/ConfigManager.hpp48
-rw-r--r--src/debug/HyprCtl.cpp30
-rw-r--r--src/desktop/Window.cpp16
-rw-r--r--src/devices/IKeyboard.cpp2
-rw-r--r--src/helpers/Monitor.cpp4
-rw-r--r--src/layout/DwindleLayout.cpp4
-rw-r--r--src/layout/MasterLayout.cpp4
-rw-r--r--src/main.cpp2
-rw-r--r--src/managers/KeybindManager.cpp10
-rw-r--r--src/managers/input/Touch.cpp4
-rw-r--r--src/protocols/OutputManagement.cpp4
-rw-r--r--src/render/OpenGL.cpp20
-rw-r--r--src/render/Renderer.cpp2
-rw-r--r--src/render/decorations/CHyprBorderDecoration.cpp6
-rw-r--r--src/render/decorations/CHyprGroupBarDecoration.cpp8
18 files changed, 343 insertions, 343 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index a34078f9..8edd1905 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -479,7 +479,7 @@ void CCompositor::initAllSignals() {
m->applyMonitorRule(&m->activeMonitorRule, true);
}
- g_pConfigManager->m_bWantsMonitorReload = true;
+ g_pConfigManager->m_wantsMonitorReload = true;
g_pCursorManager->syncGsettings();
} else {
Debug::log(LOG, "Session got deactivated!");
@@ -3039,7 +3039,7 @@ void CCompositor::onNewMonitor(SP<Aquamarine::IOutput> output) {
g_pCompositor->m_bReadyToProcess = true;
- g_pConfigManager->m_bWantsMonitorReload = true;
+ g_pConfigManager->m_wantsMonitorReload = true;
g_pCompositor->scheduleFrameForMonitor(PNEWMONITOR, IOutput::AQ_SCHEDULE_NEW_MONITOR);
checkDefaultCursorWarp(PNEWMONITOR);
diff --git a/src/config/ConfigDataValues.hpp b/src/config/ConfigDataValues.hpp
index 901fb317..270f6880 100644
--- a/src/config/ConfigDataValues.hpp
+++ b/src/config/ConfigDataValues.hpp
@@ -22,7 +22,7 @@ class CGradientValueData : public ICustomConfigValueData {
public:
CGradientValueData() = default;
CGradientValueData(CHyprColor col) {
- m_vColors.push_back(col);
+ m_colors.push_back(col);
updateColorsOk();
};
virtual ~CGradientValueData() = default;
@@ -32,39 +32,39 @@ class CGradientValueData : public ICustomConfigValueData {
}
void reset(CHyprColor col) {
- m_vColors.clear();
- m_vColors.emplace_back(col);
- m_fAngle = 0;
+ m_colors.clear();
+ m_colors.emplace_back(col);
+ m_angle = 0;
updateColorsOk();
}
void updateColorsOk() {
- m_vColorsOkLabA.clear();
- for (auto& c : m_vColors) {
+ m_colorsOkLabA.clear();
+ for (auto& c : m_colors) {
const auto OKLAB = c.asOkLab();
- m_vColorsOkLabA.emplace_back(OKLAB.l);
- m_vColorsOkLabA.emplace_back(OKLAB.a);
- m_vColorsOkLabA.emplace_back(OKLAB.b);
- m_vColorsOkLabA.emplace_back(c.a);
+ m_colorsOkLabA.emplace_back(OKLAB.l);
+ m_colorsOkLabA.emplace_back(OKLAB.a);
+ m_colorsOkLabA.emplace_back(OKLAB.b);
+ m_colorsOkLabA.emplace_back(c.a);
}
}
/* Vector containing the colors */
- std::vector<CHyprColor> m_vColors;
+ std::vector<CHyprColor> m_colors;
/* Vector containing pure colors for shoving into opengl */
- std::vector<float> m_vColorsOkLabA;
+ std::vector<float> m_colorsOkLabA;
/* Float corresponding to the angle (rad) */
- float m_fAngle = 0;
+ float m_angle = 0;
//
bool operator==(const CGradientValueData& other) const {
- if (other.m_vColors.size() != m_vColors.size() || m_fAngle != other.m_fAngle)
+ if (other.m_colors.size() != m_colors.size() || m_angle != other.m_angle)
return false;
- for (size_t i = 0; i < m_vColors.size(); ++i)
- if (m_vColors[i] != other.m_vColors[i])
+ for (size_t i = 0; i < m_colors.size(); ++i)
+ if (m_colors[i] != other.m_colors[i])
return false;
return true;
@@ -72,28 +72,28 @@ class CGradientValueData : public ICustomConfigValueData {
virtual std::string toString() {
std::string result;
- for (auto& c : m_vColors) {
+ for (auto& c : m_colors) {
result += std::format("{:x} ", c.getAsHex());
}
- result += std::format("{}deg", (int)(m_fAngle * 180.0 / M_PI));
+ result += std::format("{}deg", (int)(m_angle * 180.0 / M_PI));
return result;
}
};
class CCssGapData : public ICustomConfigValueData {
public:
- CCssGapData() : top(0), right(0), bottom(0), left(0) {};
- CCssGapData(int64_t global) : top(global), right(global), bottom(global), left(global) {};
- CCssGapData(int64_t vertical, int64_t horizontal) : top(vertical), right(horizontal), bottom(vertical), left(horizontal) {};
- CCssGapData(int64_t top, int64_t horizontal, int64_t bottom) : top(top), right(horizontal), bottom(bottom), left(horizontal) {};
- CCssGapData(int64_t top, int64_t right, int64_t bottom, int64_t left) : top(top), right(right), bottom(bottom), left(left) {};
+ CCssGapData() : m_top(0), m_right(0), m_bottom(0), m_left(0) {};
+ CCssGapData(int64_t global) : m_top(global), m_right(global), m_bottom(global), m_left(global) {};
+ CCssGapData(int64_t vertical, int64_t horizontal) : m_top(vertical), m_right(horizontal), m_bottom(vertical), m_left(horizontal) {};
+ CCssGapData(int64_t top, int64_t horizontal, int64_t bottom) : m_top(top), m_right(horizontal), m_bottom(bottom), m_left(horizontal) {};
+ CCssGapData(int64_t top, int64_t right, int64_t bottom, int64_t left) : m_top(top), m_right(right), m_bottom(bottom), m_left(left) {};
/* Css like directions */
- int64_t top;
- int64_t right;
- int64_t bottom;
- int64_t left;
+ int64_t m_top;
+ int64_t m_right;
+ int64_t m_bottom;
+ int64_t m_left;
void parseGapData(CVarList varlist) {
switch (varlist.size()) {
@@ -122,10 +122,10 @@ class CCssGapData : public ICustomConfigValueData {
}
void reset(int64_t global) {
- top = global;
- right = global;
- bottom = global;
- left = global;
+ m_top = global;
+ m_right = global;
+ m_bottom = global;
+ m_left = global;
}
virtual eConfigValueDataTypes getDataType() {
@@ -133,6 +133,6 @@ class CCssGapData : public ICustomConfigValueData {
}
virtual std::string toString() {
- return std::format("{} {} {} {}", top, right, bottom, left);
+ return std::format("{} {} {} {}", m_top, m_right, m_bottom, m_left);
}
};
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index b9c93295..540dcede 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -66,7 +66,7 @@ static Hyprlang::CParseResult configHandleGradientSet(const char* VALUE, void**
const auto DATA = reinterpret_cast<CGradientValueData*>(*data);
CVarList varlist(V, 0, ' ');
- DATA->m_vColors.clear();
+ DATA->m_colors.clear();
std::string parseError = "";
@@ -74,7 +74,7 @@ static Hyprlang::CParseResult configHandleGradientSet(const char* VALUE, void**
if (var.find("deg") != std::string::npos) {
// last arg
try {
- DATA->m_fAngle = std::stoi(var.substr(0, var.find("deg"))) * (PI / 180.0); // radians
+ DATA->m_angle = std::stoi(var.substr(0, var.find("deg"))) * (PI / 180.0); // radians
} catch (...) {
Debug::log(WARN, "Error parsing gradient {}", V);
parseError = "Error parsing gradient " + V;
@@ -83,7 +83,7 @@ static Hyprlang::CParseResult configHandleGradientSet(const char* VALUE, void**
break;
}
- if (DATA->m_vColors.size() >= 10) {
+ if (DATA->m_colors.size() >= 10) {
Debug::log(WARN, "Error parsing gradient {}: max colors is 10.", V);
parseError = "Error parsing gradient " + V + ": max colors is 10.";
break;
@@ -93,19 +93,19 @@ static Hyprlang::CParseResult configHandleGradientSet(const char* VALUE, void**
const auto COL = configStringToInt(var);
if (!COL)
throw std::runtime_error(std::format("failed to parse {} as a color", var));
- DATA->m_vColors.emplace_back(COL.value());
+ DATA->m_colors.emplace_back(COL.value());
} catch (std::exception& e) {
Debug::log(WARN, "Error parsing gradient {}", V);
parseError = "Error parsing gradient " + V + ": " + e.what();
}
}
- if (DATA->m_vColors.size() == 0) {
+ if (DATA->m_colors.size() == 0) {
Debug::log(WARN, "Error parsing gradient {}", V);
if (parseError.empty())
parseError = "Error parsing gradient " + V + ": No colors?";
- DATA->m_vColors.emplace_back(0); // transparent
+ DATA->m_colors.emplace_back(0); // transparent
}
DATA->updateColorsOk();
@@ -389,34 +389,34 @@ static Hyprlang::CParseResult handlePermission(const char* c, const char* v) {
void CConfigManager::registerConfigVar(const char* name, const Hyprlang::INT& val) {
m_configValueNumber++;
- m_pConfig->addConfigValue(name, val);
+ m_config->addConfigValue(name, val);
}
void CConfigManager::registerConfigVar(const char* name, const Hyprlang::FLOAT& val) {
m_configValueNumber++;
- m_pConfig->addConfigValue(name, val);
+ m_config->addConfigValue(name, val);
}
void CConfigManager::registerConfigVar(const char* name, const Hyprlang::VEC2& val) {
m_configValueNumber++;
- m_pConfig->addConfigValue(name, val);
+ m_config->addConfigValue(name, val);
}
void CConfigManager::registerConfigVar(const char* name, const Hyprlang::STRING& val) {
m_configValueNumber++;
- m_pConfig->addConfigValue(name, val);
+ m_config->addConfigValue(name, val);
}
void CConfigManager::registerConfigVar(const char* name, Hyprlang::CUSTOMTYPE&& val) {
m_configValueNumber++;
- m_pConfig->addConfigValue(name, std::move(val));
+ m_config->addConfigValue(name, std::move(val));
}
CConfigManager::CConfigManager() {
const auto ERR = verifyConfigExists();
m_configPaths.emplace_back(getMainConfigPath());
- m_pConfig = makeUnique<Hyprlang::CConfig>(m_configPaths.begin()->c_str(), Hyprlang::SConfigOptions{.throwAllErrors = true, .allowMissingConfig = true});
+ m_config = makeUnique<Hyprlang::CConfig>(m_configPaths.begin()->c_str(), Hyprlang::SConfigOptions{.throwAllErrors = true, .allowMissingConfig = true});
registerConfigVar("general:border_size", Hyprlang::INT{1});
registerConfigVar("general:no_border_on_floating", Hyprlang::INT{0});
@@ -722,71 +722,71 @@ CConfigManager::CConfigManager() {
registerConfigVar("experimental:xx_color_management_v4", Hyprlang::INT{0});
// devices
- m_pConfig->addSpecialCategory("device", {"name"});
- m_pConfig->addSpecialConfigValue("device", "sensitivity", {0.F});
- m_pConfig->addSpecialConfigValue("device", "accel_profile", {STRVAL_EMPTY});
- m_pConfig->addSpecialConfigValue("device", "kb_file", {STRVAL_EMPTY});
- m_pConfig->addSpecialConfigValue("device", "kb_layout", {"us"});
- m_pConfig->addSpecialConfigValue("device", "kb_variant", {STRVAL_EMPTY});
- m_pConfig->addSpecialConfigValue("device", "kb_options", {STRVAL_EMPTY});
- m_pConfig->addSpecialConfigValue("device", "kb_rules", {STRVAL_EMPTY});
- m_pConfig->addSpecialConfigValue("device", "kb_model", {STRVAL_EMPTY});
- m_pConfig->addSpecialConfigValue("device", "repeat_rate", Hyprlang::INT{25});
- m_pConfig->addSpecialConfigValue("device", "repeat_delay", Hyprlang::INT{600});
- m_pConfig->addSpecialConfigValue("device", "natural_scroll", Hyprlang::INT{0});
- m_pConfig->addSpecialConfigValue("device", "tap_button_map", {STRVAL_EMPTY});
- m_pConfig->addSpecialConfigValue("device", "numlock_by_default", Hyprlang::INT{0});
- m_pConfig->addSpecialConfigValue("device", "resolve_binds_by_sym", Hyprlang::INT{0});
- m_pConfig->addSpecialConfigValue("device", "disable_while_typing", Hyprlang::INT{1});
- m_pConfig->addSpecialConfigValue("device", "clickfinger_behavior", Hyprlang::INT{0});
- m_pConfig->addSpecialConfigValue("device", "middle_button_emulation", Hyprlang::INT{0});
- m_pConfig->addSpecialConfigValue("device", "tap-to-click", Hyprlang::INT{1});
- m_pConfig->addSpecialConfigValue("device", "tap-and-drag", Hyprlang::INT{1});
- m_pConfig->addSpecialConfigValue("device", "drag_lock", Hyprlang::INT{0});
- m_pConfig->addSpecialConfigValue("device", "left_handed", Hyprlang::INT{0});
- m_pConfig->addSpecialConfigValue("device", "scroll_method", {STRVAL_EMPTY});
- m_pConfig->addSpecialConfigValue("device", "scroll_button", Hyprlang::INT{0});
- m_pConfig->addSpecialConfigValue("device", "scroll_button_lock", Hyprlang::INT{0});
- m_pConfig->addSpecialConfigValue("device", "scroll_points", {STRVAL_EMPTY});
- m_pConfig->addSpecialConfigValue("device", "transform", Hyprlang::INT{-1});
- m_pConfig->addSpecialConfigValue("device", "output", {STRVAL_EMPTY});
- m_pConfig->addSpecialConfigValue("device", "enabled", Hyprlang::INT{1}); // only for mice, touchpads, and touchdevices
- m_pConfig->addSpecialConfigValue("device", "region_position", Hyprlang::VEC2{0, 0}); // only for tablets
- m_pConfig->addSpecialConfigValue("device", "absolute_region_position", Hyprlang::INT{0}); // only for tablets
- m_pConfig->addSpecialConfigValue("device", "region_size", Hyprlang::VEC2{0, 0}); // only for tablets
- m_pConfig->addSpecialConfigValue("device", "relative_input", Hyprlang::INT{0}); // only for tablets
- m_pConfig->addSpecialConfigValue("device", "active_area_position", Hyprlang::VEC2{0, 0}); // only for tablets
- m_pConfig->addSpecialConfigValue("device", "active_area_size", Hyprlang::VEC2{0, 0}); // only for tablets
- m_pConfig->addSpecialConfigValue("device", "flip_x", Hyprlang::INT{0}); // only for touchpads
- m_pConfig->addSpecialConfigValue("device", "flip_y", Hyprlang::INT{0}); // only for touchpads
- m_pConfig->addSpecialConfigValue("device", "keybinds", Hyprlang::INT{1}); // enable/disable keybinds
+ m_config->addSpecialCategory("device", {"name"});
+ m_config->addSpecialConfigValue("device", "sensitivity", {0.F});
+ m_config->addSpecialConfigValue("device", "accel_profile", {STRVAL_EMPTY});
+ m_config->addSpecialConfigValue("device", "kb_file", {STRVAL_EMPTY});
+ m_config->addSpecialConfigValue("device", "kb_layout", {"us"});
+ m_config->addSpecialConfigValue("device", "kb_variant", {STRVAL_EMPTY});
+ m_config->addSpecialConfigValue("device", "kb_options", {STRVAL_EMPTY});
+ m_config->addSpecialConfigValue("device", "kb_rules", {STRVAL_EMPTY});
+ m_config->addSpecialConfigValue("device", "kb_model", {STRVAL_EMPTY});
+ m_config->addSpecialConfigValue("device", "repeat_rate", Hyprlang::INT{25});
+ m_config->addSpecialConfigValue("device", "repeat_delay", Hyprlang::INT{600});
+ m_config->addSpecialConfigValue("device", "natural_scroll", Hyprlang::INT{0});
+ m_config->addSpecialConfigValue("device", "tap_button_map", {STRVAL_EMPTY});
+ m_config->addSpecialConfigValue("device", "numlock_by_default", Hyprlang::INT{0});
+ m_config->addSpecialConfigValue("device", "resolve_binds_by_sym", Hyprlang::INT{0});
+ m_config->addSpecialConfigValue("device", "disable_while_typing", Hyprlang::INT{1});
+ m_config->addSpecialConfigValue("device", "clickfinger_behavior", Hyprlang::INT{0});
+ m_config->addSpecialConfigValue("device", "middle_button_emulation", Hyprlang::INT{0});
+ m_config->addSpecialConfigValue("device", "tap-to-click", Hyprlang::INT{1});
+ m_config->addSpecialConfigValue("device", "tap-and-drag", Hyprlang::INT{1});
+ m_config->addSpecialConfigValue("device", "drag_lock", Hyprlang::INT{0});
+ m_config->addSpecialConfigValue("device", "left_handed", Hyprlang::INT{0});
+ m_config->addSpecialConfigValue("device", "scroll_method", {STRVAL_EMPTY});
+ m_config->addSpecialConfigValue("device", "scroll_button", Hyprlang::INT{0});
+ m_config->addSpecialConfigValue("device", "scroll_button_lock", Hyprlang::INT{0});
+ m_config->addSpecialConfigValue("device", "scroll_points", {STRVAL_EMPTY});
+ m_config->addSpecialConfigValue("device", "transform", Hyprlang::INT{-1});
+ m_config->addSpecialConfigValue("device", "output", {STRVAL_EMPTY});
+ m_config->addSpecialConfigValue("device", "enabled", Hyprlang::INT{1}); // only for mice, touchpads, and touchdevices
+ m_config->addSpecialConfigValue("device", "region_position", Hyprlang::VEC2{0, 0}); // only for tablets
+ m_config->addSpecialConfigValue("device", "absolute_region_position", Hyprlang::INT{0}); // only for tablets
+ m_config->addSpecialConfigValue("device", "region_size", Hyprlang::VEC2{0, 0}); // only for tablets
+ m_config->addSpecialConfigValue("device", "relative_input", Hyprlang::INT{0}); // only for tablets
+ m_config->addSpecialConfigValue("device", "active_area_position", Hyprlang::VEC2{0, 0}); // only for tablets
+ m_config->addSpecialConfigValue("device", "active_area_size", Hyprlang::VEC2{0, 0}); // only for tablets
+ m_config->addSpecialConfigValue("device", "flip_x", Hyprlang::INT{0}); // only for touchpads
+ m_config->addSpecialConfigValue("device", "flip_y", Hyprlang::INT{0}); // only for touchpads
+ m_config->addSpecialConfigValue("device", "keybinds", Hyprlang::INT{1}); // enable/disable keybinds
// keywords
- m_pConfig->registerHandler(&::handleExec, "exec", {false});
- m_pConfig->registerHandler(&::handleRawExec, "execr", {false});
- m_pConfig->registerHandler(&::handleExecOnce, "exec-once", {false});
- m_pConfig->registerHandler(&::handleExecRawOnce, "execr-once", {false});
- m_pConfig->registerHandler(&::handleExecShutdown, "exec-shutdown", {false});
- m_pConfig->registerHandler(&::handleMonitor, "monitor", {false});
- m_pConfig->registerHandler(&::handleBind, "bind", {true});
- m_pConfig->registerHandler(&::handleUnbind, "unbind", {false});
- m_pConfig->registerHandler(&::handleWorkspaceRules, "workspace", {false});
- m_pConfig->registerHandler(&::handleWindowRule, "windowrule", {false});
- m_pConfig->registerHandler(&::handleLayerRule, "layerrule", {false});
- m_pConfig->registerHandler(&::handleWindowRuleV2, "windowrulev2", {false});
- m_pConfig->registerHandler(&::handleBezier, "bezier", {false});
- m_pConfig->registerHandler(&::handleAnimation, "animation", {false});
- m_pConfig->registerHandler(&::handleSource, "source", {false});
- m_pConfig->registerHandler(&::handleSubmap, "submap", {false});
- m_pConfig->registerHandler(&::handleBlurLS, "blurls", {false});
- m_pConfig->registerHandler(&::handlePlugin, "plugin", {false});
- m_pConfig->registerHandler(&::handlePermission, "permission", {false});
- m_pConfig->registerHandler(&::handleEnv, "env", {true});
+ m_config->registerHandler(&::handleExec, "exec", {false});
+ m_config->registerHandler(&::handleRawExec, "execr", {false});
+ m_config->registerHandler(&::handleExecOnce, "exec-once", {false});
+ m_config->registerHandler(&::handleExecRawOnce, "execr-once", {false});
+ m_config->registerHandler(&::handleExecShutdown, "exec-shutdown", {false});
+ m_config->registerHandler(&::handleMonitor, "monitor", {false});
+ m_config->registerHandler(&::handleBind, "bind", {true});
+ m_config->registerHandler(&::handleUnbind, "unbind", {false});
+ m_config->registerHandler(&::handleWorkspaceRules, "workspace", {false});
+ m_config->registerHandler(&::handleWindowRule, "windowrule", {false});
+ m_config->registerHandler(&::handleLayerRule, "layerrule", {false});
+ m_config->registerHandler(&::handleWindowRuleV2, "windowrulev2", {false});
+ m_config->registerHandler(&::handleBezier, "bezier", {false});
+ m_config->registerHandler(&::handleAnimation, "animation", {false});
+ m_config->registerHandler(&::handleSource, "source", {false});
+ m_config->registerHandler(&::handleSubmap, "submap", {false});
+ m_config->registerHandler(&::handleBlurLS, "blurls", {false});
+ m_config->registerHandler(&::handlePlugin, "plugin", {false});
+ m_config->registerHandler(&::handlePermission, "permission", {false});
+ m_config->registerHandler(&::handleEnv, "env", {true});
// pluginza
- m_pConfig->addSpecialCategory("plugin", {nullptr, true});
+ m_config->addSpecialCategory("plugin", {nullptr, true});
- m_pConfig->commence();
+ m_config->commence();
resetHLConfig();
@@ -800,8 +800,8 @@ CConfigManager::CConfigManager() {
"https://wiki.hyprland.org/Configuring/Variables/#debug");
}
- Debug::disableLogs = reinterpret_cast<int64_t* const*>(m_pConfig->getConfigValuePtr("debug:disable_logs")->getDataStaticPtr());
- Debug::disableTime = reinterpret_cast<int64_t* const*>(m_pConfig->getConfigValuePtr("debug:disable_time")->getDataStaticPtr());
+ Debug::disableLogs = reinterpret_cast<int64_t* const*>(m_config->getConfigValuePtr("debug:disable_logs")->getDataStaticPtr());
+ Debug::disableTime = reinterpret_cast<int64_t* const*>(m_config->getConfigValuePtr("debug:disable_time")->getDataStaticPtr());
if (g_pEventLoopManager && ERR.has_value())
g_pEventLoopManager->doLater([ERR] { g_pHyprError->queueCreate(ERR.value(), CHyprColor{1.0, 0.1, 0.1, 1.0}); });
@@ -879,89 +879,89 @@ std::string CConfigManager::getConfigString() {
}
std::string CConfigManager::getErrors() {
- return m_szConfigErrors;
+ return m_configErrors;
}
void CConfigManager::reload() {
EMIT_HOOK_EVENT("preConfigReload", nullptr);
setDefaultAnimationVars();
resetHLConfig();
- configCurrentPath = getMainConfigPath();
- const auto ERR = m_pConfig->parse();
- m_bLastConfigVerificationWasSuccessful = !ERR.error;
+ m_configCurrentPath = getMainConfigPath();
+ const auto ERR = m_config->parse();
+ m_lastConfigVerificationWasSuccessful = !ERR.error;
postConfigReload(ERR);
}
std::string CConfigManager::verify() {
setDefaultAnimationVars();
resetHLConfig();
- configCurrentPath = getMainConfigPath();
- const auto ERR = m_pConfig->parse();
- m_bLastConfigVerificationWasSuccessful = !ERR.error;
+ m_configCurrentPath = getMainConfigPath();
+ const auto ERR = m_config->parse();
+ m_lastConfigVerificationWasSuccessful = !ERR.error;
if (ERR.error)
return ERR.getError();
return "config ok";
}
void CConfigManager::setDefaultAnimationVars() {
- m_AnimationTree.createNode("__internal_fadeCTM");
- m_AnimationTree.createNode("global");
+ m_animationTree.createNode("__internal_fadeCTM");
+ m_animationTree.createNode("global");
// global
- m_AnimationTree.createNode("windows", "global");
- m_AnimationTree.createNode("layers", "global");
- m_AnimationTree.createNode("fade", "global");
- m_AnimationTree.createNode("border", "global");
- m_AnimationTree.createNode("borderangle", "global");
- m_AnimationTree.createNode("workspaces", "global");
+ m_animationTree.createNode("windows", "global");
+ m_animationTree.createNode("layers", "global");
+ m_animationTree.createNode("fade", "global");
+ m_animationTree.createNode("border", "global");
+ m_animationTree.createNode("borderangle", "global");
+ m_animationTree.createNode("workspaces", "global");
// layer
- m_AnimationTree.createNode("layersIn", "layers");
- m_AnimationTree.createNode("layersOut", "layers");
+ m_animationTree.createNode("layersIn", "layers");
+ m_animationTree.createNode("layersOut", "layers");
// windows
- m_AnimationTree.createNode("windowsIn", "windows");
- m_AnimationTree.createNode("windowsOut", "windows");
- m_AnimationTree.createNode("windowsMove", "windows");
+ m_animationTree.createNode("windowsIn", "windows");
+ m_animationTree.createNode("windowsOut", "windows");
+ m_animationTree.createNode("windowsMove", "windows");
// fade
- m_AnimationTree.createNode("fadeIn", "fade");
- m_AnimationTree.createNode("fadeOut", "fade");
- m_AnimationTree.createNode("fadeSwitch", "fade");
- m_AnimationTree.createNode("fadeShadow", "fade");
- m_AnimationTree.createNode("fadeDim", "fade");
- m_AnimationTree.createNode("fadeLayers", "fade");
- m_AnimationTree.createNode("fadeLayersIn", "fadeLayers");
- m_AnimationTree.createNode("fadeLayersOut", "fadeLayers");
+ m_animationTree.createNode("fadeIn", "fade");
+ m_animationTree.createNode("fadeOut", "fade");
+ m_animationTree.createNode("fadeSwitch", "fade");
+ m_animationTree.createNode("fadeShadow", "fade");
+ m_animationTree.createNode("fadeDim", "fade");
+ m_animationTree.createNode("fadeLayers", "fade");
+ m_animationTree.createNode("fadeLayersIn", "fadeLayers");
+ m_animationTree.createNode("fadeLayersOut", "fadeLayers");
// workspaces
- m_AnimationTree.createNode("workspacesIn", "workspaces");
- m_AnimationTree.createNode("workspacesOut", "workspaces");
- m_AnimationTree.createNode("specialWorkspace", "workspaces");
- m_AnimationTree.createNode("specialWorkspaceIn", "specialWorkspace");
- m_AnimationTree.createNode("specialWorkspaceOut", "specialWorkspace");
+ m_animationTree.createNode("workspacesIn", "workspaces");
+ m_animationTree.createNode("workspacesOut", "workspaces");
+ m_animationTree.createNode("specialWorkspace", "workspaces");
+ m_animationTree.createNode("specialWorkspaceIn", "specialWorkspace");
+ m_animationTree.createNode("specialWorkspaceOut", "specialWorkspace");
// init the root nodes
- m_AnimationTree.setConfigForNode("global", 1, 8.f, "default");
- m_AnimationTree.setConfigForNode("__internal_fadeCTM", 1, 5.f, "linear");
- m_AnimationTree.setConfigForNode("borderangle", 0, 1, "default");
+ m_animationTree.setConfigForNode("global", 1, 8.f, "default");
+ m_animationTree.setConfigForNode("__internal_fadeCTM", 1, 5.f, "linear");
+ m_animationTree.setConfigForNode("borderangle", 0, 1, "default");
}
std::optional<std::string> CConfigManager::resetHLConfig() {
- m_vMonitorRules.clear();
- m_vWindowRules.clear();
+ m_monitorRules.clear();
+ m_windowRules.clear();
g_pKeybindManager->clearKeybinds();
g_pAnimationManager->removeAllBeziers();
g_pAnimationManager->addBezierWithName("linear", Vector2D(0.0, 0.0), Vector2D(1.0, 1.0));
m_mAdditionalReservedAreas.clear();
- m_dBlurLSNamespaces.clear();
- m_vWorkspaceRules.clear();
+ m_blurLSNamespaces.clear();
+ m_workspaceRules.clear();
setDefaultAnimationVars(); // reset anims
- m_vDeclaredPlugins.clear();
- m_vLayerRules.clear();
- m_vFailedPluginConfigValues.clear();
- finalExecRequests.clear();
+ m_declaredPlugins.clear();
+ m_layerRules.clear();
+ m_failedPluginConfigValues.clear();
+ m_finalExecRequests.clear();
g_pDynamicPermissionManager->clearConfigPermissions();
@@ -995,7 +995,7 @@ void CConfigManager::postConfigReload(const Hyprlang::CParseResult& result) {
g_pLayoutManager->getCurrentLayout()->recalculateMonitor(m->ID);
// Update the keyboard layout to the cfg'd one if this is not the first launch
- if (!isFirstLaunch) {
+ if (!m_isFirstLaunch) {
g_pInputManager->setKeyboardLayout();
g_pInputManager->setPointerConfigs();
g_pInputManager->setTouchDeviceConfigs();
@@ -1009,13 +1009,13 @@ void CConfigManager::postConfigReload(const Hyprlang::CParseResult& result) {
// parseError will be displayed next frame
if (result.error)
- m_szConfigErrors = result.getError();
+ m_configErrors = result.getError();
else
- m_szConfigErrors = "";
+ m_configErrors = "";
- if (result.error && !std::any_cast<Hyprlang::INT>(m_pConfig->getConfigValue("debug:suppress_errors")))
+ if (result.error && !std::any_cast<Hyprlang::INT>(m_config->getConfigValue("debug:suppress_errors")))
g_pHyprError->queueCreate(result.getError(), CHyprColor(1.0, 50.0 / 255.0, 50.0 / 255.0, 1.0));
- else if (std::any_cast<Hyprlang::INT>(m_pConfig->getConfigValue("autogenerated")) == 1)
+ else if (std::any_cast<Hyprlang::INT>(m_config->getConfigValue("autogenerated")) == 1)
g_pHyprError->queueCreate(
"Warning: You're using an autogenerated config! Edit the config file to get rid of this message. (config file: " + getMainConfigPath() +
" )\nSUPER+Q -> kitty (if it doesn't launch, make sure it's installed or choose a different terminal in the config)\nSUPER+M -> exit Hyprland",
@@ -1029,7 +1029,7 @@ void CConfigManager::postConfigReload(const Hyprlang::CParseResult& result) {
// not on first launch because monitors might not exist yet
// and they'll be taken care of in the newMonitor event
// ignore if nomonitorreload is set
- if (!isFirstLaunch && !m_bNoMonitorReload) {
+ if (!m_isFirstLaunch && !m_noMonitorReload) {
// check
performMonitorReload();
ensureMonitorStatus();
@@ -1037,10 +1037,10 @@ void CConfigManager::postConfigReload(const Hyprlang::CParseResult& result) {
}
#ifndef NO_XWAYLAND
- const auto PENABLEXWAYLAND = std::any_cast<Hyprlang::INT>(m_pConfig->getConfigValue("xwayland:enabled"));
+ const auto PENABLEXWAYLAND = std::any_cast<Hyprlang::INT>(m_config->getConfigValue("xwayland:enabled"));
g_pCompositor->m_bWantsXwayland = PENABLEXWAYLAND;
// enable/disable xwayland usage
- if (!isFirstLaunch &&
+ if (!m_isFirstLaunch &&
g_pXWayland /* XWayland has to be initialized by CCompositor::initManagers for this to make sense, and it doesn't have to be (e.g. very early plugin load) */) {
bool prevEnabledXwayland = g_pXWayland->enabled();
if (g_pCompositor->m_bWantsXwayland != prevEnabledXwayland)
@@ -1049,7 +1049,7 @@ void CConfigManager::postConfigReload(const Hyprlang::CParseResult& result) {
g_pCompositor->m_bWantsXwayland = PENABLEXWAYLAND;
#endif
- if (!isFirstLaunch && !g_pCompositor->m_bUnsafeState)
+ if (!m_isFirstLaunch && !g_pCompositor->m_bUnsafeState)
refreshGroupBarGradients();
// Updates dynamic window and workspace rules
@@ -1064,23 +1064,23 @@ void CConfigManager::postConfigReload(const Hyprlang::CParseResult& result) {
g_pCompositor->updateAllWindowsAnimatedDecorationValues();
// update layout
- g_pLayoutManager->switchToLayout(std::any_cast<Hyprlang::STRING>(m_pConfig->getConfigValue("general:layout")));
+ g_pLayoutManager->switchToLayout(std::any_cast<Hyprlang::STRING>(m_config->getConfigValue("general:layout")));
// manual crash
- if (std::any_cast<Hyprlang::INT>(m_pConfig->getConfigValue("debug:manual_crash")) && !m_bManualCrashInitiated) {
- m_bManualCrashInitiated = true;
+ if (std::any_cast<Hyprlang::INT>(m_config->getConfigValue("debug:manual_crash")) && !m_manualCrashInitiated) {
+ m_manualCrashInitiated = true;
g_pHyprNotificationOverlay->addNotification("Manual crash has been set up. Set debug:manual_crash back to 0 in order to crash the compositor.", CHyprColor(0), 5000,
ICON_INFO);
- } else if (m_bManualCrashInitiated && !std::any_cast<Hyprlang::INT>(m_pConfig->getConfigValue("debug:manual_crash"))) {
+ } else if (m_manualCrashInitiated && !std::any_cast<Hyprlang::INT>(m_config->getConfigValue("debug:manual_crash"))) {
// cowabunga it is
g_pHyprRenderer->initiateManualCrash();
}
- Debug::disableStdout = !std::any_cast<Hyprlang::INT>(m_pConfig->getConfigValue("debug:enable_stdout_logs"));
- if (Debug::disableStdout && isFirstLaunch)
+ Debug::disableStdout = !std::any_cast<Hyprlang::INT>(m_config->getConfigValue("debug:enable_stdout_logs"));
+ if (Debug::disableStdout && m_isFirstLaunch)
Debug::log(LOG, "Disabling stdout logs! Check the log for further logs.");
- Debug::coloredLogs = reinterpret_cast<int64_t* const*>(m_pConfig->getConfigValuePtr("debug:colored_stdout_logs")->getDataStaticPtr());
+ Debug::coloredLogs = reinterpret_cast<int64_t* const*>(m_config->getConfigValuePtr("debug:colored_stdout_logs")->getDataStaticPtr());
for (auto const& m : g_pCompositor->m_vMonitors) {
// mark blur dirty
@@ -1097,13 +1097,13 @@ void CConfigManager::postConfigReload(const Hyprlang::CParseResult& result) {
}
// Reset no monitor reload
- m_bNoMonitorReload = false;
+ m_noMonitorReload = false;
// update plugins
handlePluginLoads();
// update persistent workspaces
- if (!isFirstLaunch)
+ if (!m_isFirstLaunch)
ensurePersistentWorkspacesPresent();
EMIT_HOOK_EVENT("configReloaded", nullptr);
@@ -1121,14 +1121,14 @@ void CConfigManager::init() {
const std::string CONFIGPATH = getMainConfigPath();
reload();
- isFirstLaunch = false;
+ m_isFirstLaunch = false;
}
std::string CConfigManager::parseKeyword(const std::string& COMMAND, const std::string& VALUE) {
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());
+ const auto RET = m_config->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:")) {
@@ -1147,13 +1147,13 @@ std::string CConfigManager::parseKeyword(const std::string& COMMAND, const std::
g_pCompositor->updateAllWindowsAnimatedDecorationValues();
// manual crash
- if (std::any_cast<Hyprlang::INT>(m_pConfig->getConfigValue("debug:manual_crash")) && !m_bManualCrashInitiated) {
- m_bManualCrashInitiated = true;
+ if (std::any_cast<Hyprlang::INT>(m_config->getConfigValue("debug:manual_crash")) && !m_manualCrashInitiated) {
+ m_manualCrashInitiated = true;
if (g_pHyprNotificationOverlay) {
g_pHyprNotificationOverlay->addNotification("Manual crash has been set up. Set debug:manual_crash back to 0 in order to crash the compositor.", CHyprColor(0), 5000,
ICON_INFO);
}
- } else if (m_bManualCrashInitiated && !std::any_cast<Hyprlang::INT>(m_pConfig->getConfigValue("debug:manual_crash"))) {
+ } else if (m_manualCrashInitiated && !std::any_cast<Hyprlang::INT>(m_config->getConfigValue("debug:manual_crash"))) {
// cowabunga it is
g_pHyprRenderer->initiateManualCrash();
}
@@ -1163,10 +1163,10 @@ std::string CConfigManager::parseKeyword(const std::string& COMMAND, const std::
Hyprlang::CConfigValue* CConfigManager::getConfigValueSafeDevice(const std::string& dev, const std::string& val, const std::string& fallback) {
- const auto VAL = m_pConfig->getSpecialConfigValuePtr("device", val.c_str(), dev.c_str());
+ const auto VAL = m_config->getSpecialConfigValuePtr("device", val.c_str(), dev.c_str());
if ((!VAL || !VAL->m_bSetByUser) && !fallback.empty()) {
- return m_pConfig->getConfigValuePtr(fallback.c_str());
+ return m_config->getConfigValuePtr(fallback.c_str());
}
return VAL;
@@ -1236,7 +1236,7 @@ SMonitorRule CConfigManager::getMonitorRuleFor(const PHLMONITOR PMONITOR) {
return rule;
};
- for (auto const& r : m_vMonitorRules | std::views::reverse) {
+ for (auto const& r : m_monitorRules | std::views::reverse) {
if (PMONITOR->matchesStaticSelector(r.name)) {
return applyWlrOutputConfig(r);
}
@@ -1244,7 +1244,7 @@ SMonitorRule CConfigManager::getMonitorRuleFor(const PHLMONITOR PMONITOR) {
Debug::log(WARN, "No rule found for {}, trying to use the first.", PMONITOR->szName);
- for (auto const& r : m_vMonitorRules) {
+ for (auto const& r : m_monitorRules) {
if (r.name.empty()) {
return applyWlrOutputConfig(r);
}
@@ -1261,7 +1261,7 @@ SMonitorRule CConfigManager::getMonitorRuleFor(const PHLMONITOR PMONITOR) {
SWorkspaceRule CConfigManager::getWorkspaceRuleFor(PHLWORKSPACE pWorkspace) {
SWorkspaceRule mergedRule{};
- for (auto const& rule : m_vWorkspaceRules) {
+ for (auto const& rule : m_workspaceRules) {
if (!pWorkspace->matchesStaticSelector(rule.workspaceString))
continue;
@@ -1331,7 +1331,7 @@ std::vector<SP<CWindowRule>> CConfigManager::getMatchingRules(PHLWINDOW pWindow,
// local tags for dynamic tag rule match
auto tags = pWindow->m_tags;
- for (auto const& rule : m_vWindowRules) {
+ for (auto const& rule : m_windowRules) {
// check if we have a matching rule
if (!rule->v2) {
try {
@@ -1484,7 +1484,7 @@ std::vector<SP<CWindowRule>> CConfigManager::getMatchingRules(PHLWINDOW pWindow,
bool anyExecFound = false;
- for (auto const& er : execRequestedRules) {
+ for (auto const& er : m_execRequestedRules) {
if (std::ranges::any_of(PIDs, [&](const auto& pid) { return pid == er.iPid; })) {
returns.emplace_back(makeShared<CWindowRule>(er.szRule, "", false, true));
anyExecFound = true;
@@ -1492,7 +1492,7 @@ std::vector<SP<CWindowRule>> CConfigManager::getMatchingRules(PHLWINDOW pWindow,
}
if (anyExecFound && !shadowExec) // remove exec rules to unclog searches in the future, why have the garbage here.
- std::erase_if(execRequestedRules, [&](const SExecRequestedRule& other) { return std::ranges::any_of(PIDs, [&](const auto& pid) { return pid == other.iPid; }); });
+ std::erase_if(m_execRequestedRules, [&](const SExecRequestedRule& other) { return std::ranges::any_of(PIDs, [&](const auto& pid) { return pid == other.iPid; }); });
return returns;
}
@@ -1503,7 +1503,7 @@ std::vector<SP<CLayerRule>> CConfigManager::getMatchingRules(PHLLS pLS) {
if (!pLS->layerSurface || pLS->fadingOut)
return returns;
- for (auto const& lr : m_vLayerRules) {
+ for (auto const& lr : m_layerRules) {
if (lr->targetNamespace.starts_with("address:0x")) {
if (std::format("address:0x{:x}", (uintptr_t)pLS.get()) != lr->targetNamespace)
continue;
@@ -1521,7 +1521,7 @@ std::vector<SP<CLayerRule>> CConfigManager::getMatchingRules(PHLLS pLS) {
}
void CConfigManager::dispatchExecOnce() {
- if (firstExecDispatched || isFirstLaunch)
+ if (m_firstExecDispatched || m_isFirstLaunch)
return;
// update dbus env
@@ -1533,15 +1533,15 @@ void CConfigManager::dispatchExecOnce() {
#endif
"dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP HYPRLAND_INSTANCE_SIGNATURE QT_QPA_PLATFORMTHEME PATH XDG_DATA_DIRS");
- firstExecDispatched = true;
- isLaunchingExecOnce = true;
+ m_firstExecDispatched = true;
+ m_isLaunchingExecOnce = true;
- for (auto const& c : firstExecRequests) {
+ for (auto const& c : m_firstExecRequests) {
c.withRules ? handleExec("", c.exec) : handleRawExec("", c.exec);
}
- firstExecRequests.clear(); // free some kb of memory :P
- isLaunchingExecOnce = false;
+ m_firstExecRequests.clear(); // free some kb of memory :P
+ m_isLaunchingExecOnce = false;
// set input, fixes some certain issues
g_pInputManager->setKeyboardLayout();
@@ -1554,18 +1554,18 @@ void CConfigManager::dispatchExecOnce() {
}
void CConfigManager::dispatchExecShutdown() {
- if (finalExecRequests.empty()) {
+ if (m_finalExecRequests.empty()) {
g_pCompositor->m_bFinalRequests = false;
return;
}
g_pCompositor->m_bFinalRequests = true;
- for (auto const& c : finalExecRequests) {
+ for (auto const& c : m_finalExecRequests) {
handleExecShutdown("", c);
}
- finalExecRequests.clear();
+ m_finalExecRequests.clear();
// Actually exit now
handleExecShutdown("", "hyprctl dispatch exit");
@@ -1595,13 +1595,13 @@ void CConfigManager::performMonitorReload() {
if (overAgain)
performMonitorReload();
- m_bWantsMonitorReload = false;
+ m_wantsMonitorReload = false;
EMIT_HOOK_EVENT("monitorLayoutChanged", nullptr);
}
void* const* CConfigManager::getConfigValuePtr(const std::string& val) {
- const auto VAL = m_pConfig->getConfigValuePtr(val.c_str());
+ const auto VAL = m_config->getConfigValuePtr(val.c_str());
if (!VAL)
return nullptr;
return VAL->getDataStaticPtr();
@@ -1609,20 +1609,20 @@ void* const* CConfigManager::getConfigValuePtr(const std::string& val) {
Hyprlang::CConfigValue* CConfigManager::getHyprlangConfigValuePtr(const std::string& name, const std::string& specialCat) {
if (!specialCat.empty())
- return m_pConfig->getSpecialConfigValuePtr(specialCat.c_str(), name.c_str(), nullptr);
+ return m_config->getSpecialConfigValuePtr(specialCat.c_str(), name.c_str(), nullptr);
- return m_pConfig->getConfigValuePtr(name.c_str());
+ return m_config->getConfigValuePtr(name.c_str());
}
bool CConfigManager::deviceConfigExists(const std::string& dev) {
auto copy = dev;
std::replace(copy.begin(), copy.end(), ' ', '-');
- return m_pConfig->specialCategoryExistsForKey("device", copy.c_str());
+ return m_config->specialCategoryExistsForKey("device", copy.c_str());
}
bool CConfigManager::shouldBlurLS(const std::string& ns) {
- for (auto const& bls : m_dBlurLSNamespaces) {
+ for (auto const& bls : m_blurLSNamespaces) {
if (bls == ns) {
return true;
}
@@ -1720,7 +1720,7 @@ void CConfigManager::ensureVRR(PHLMONITOR pMonitor) {
}
SP<SAnimationPropertyConfig> CConfigManager::getAnimationPropertyConfig(const std::string& name) {
- return m_AnimationTree.getConfig(name);
+ return m_animationTree.getConfig(name);
}
void CConfigManager::addParseError(const std::string& err) {
@@ -1736,7 +1736,7 @@ PHLMONITOR CConfigManager::getBoundMonitorForWS(const std::string& wsname) {
}
std::string CConfigManager::getBoundMonitorStringForWS(const std::string& wsname) {
- for (auto const& wr : m_vWorkspaceRules) {
+ for (auto const& wr : m_workspaceRules) {
const auto WSNAME = wr.workspaceName.starts_with("name:") ? wr.workspaceName.substr(5) : wr.workspaceName;
if (WSNAME == wsname)
@@ -1747,11 +1747,11 @@ std::string CConfigManager::getBoundMonitorStringForWS(const std::string& wsname
}
const std::vector<SWorkspaceRule>& CConfigManager::getAllWorkspaceRules() {
- return m_vWorkspaceRules;
+ return m_workspaceRules;
}
void CConfigManager::addExecRule(const SExecRequestedRule& rule) {
- execRequestedRules.push_back(rule);
+ m_execRequestedRules.push_back(rule);
}
void CConfigManager::handlePluginLoads() {
@@ -1759,7 +1759,7 @@ void CConfigManager::handlePluginLoads() {
return;
bool pluginsChanged = false;
- auto failedPlugins = g_pPluginSystem->updateConfigPlugins(m_vDeclaredPlugins, pluginsChanged);
+ auto failedPlugins = g_pPluginSystem->updateConfigPlugins(m_declaredPlugins, pluginsChanged);
if (!failedPlugins.empty()) {
std::stringstream error;
@@ -1779,7 +1779,7 @@ void CConfigManager::handlePluginLoads() {
}
const std::unordered_map<std::string, SP<SAnimationPropertyConfig>>& CConfigManager::getAnimationConfig() {
- return m_AnimationTree.getFullConfig();
+ return m_animationTree.getFullConfig();
}
void CConfigManager::addPluginConfigVar(HANDLE handle, const std::string& name, const Hyprlang::CConfigValue& value) {
@@ -1788,35 +1788,35 @@ void CConfigManager::addPluginConfigVar(HANDLE handle, const std::string& name,
std::string field = name.substr(7);
- m_pConfig->addSpecialConfigValue("plugin", field.c_str(), value);
- pluginVariables.push_back({handle, field});
+ m_config->addSpecialConfigValue("plugin", field.c_str(), value);
+ m_pluginVariables.push_back({handle, field});
}
void CConfigManager::addPluginKeyword(HANDLE handle, const std::string& name, Hyprlang::PCONFIGHANDLERFUNC fn, Hyprlang::SHandlerOptions opts) {
- pluginKeywords.emplace_back(SPluginKeyword{handle, name, fn});
- m_pConfig->registerHandler(fn, name.c_str(), opts);
+ m_pluginKeywords.emplace_back(SPluginKeyword{handle, name, fn});
+ m_config->registerHandler(fn, name.c_str(), opts);
}
void CConfigManager::removePluginConfig(HANDLE handle) {
- for (auto const& k : pluginKeywords) {
+ for (auto const& k : m_pluginKeywords) {
if (k.handle != handle)
continue;
- m_pConfig->unregisterHandler(k.name.c_str());
+ m_config->unregisterHandler(k.name.c_str());
}
- std::erase_if(pluginKeywords, [&](const auto& other) { return other.handle == handle; });
- for (auto const& [h, n] : pluginVariables) {
+ std::erase_if(m_pluginKeywords, [&](const auto& other) { return other.handle == handle; });
+ for (auto const& [h, n] : m_pluginVariables) {
if (h != handle)
continue;
- m_pConfig->removeSpecialConfigValue("plugin", n.c_str());
+ m_config->removeSpecialConfigValue("plugin", n.c_str());
}
- std::erase_if(pluginVariables, [handle](const auto& other) { return other.handle == handle; });
+ std::erase_if(m_pluginVariables, [handle](const auto& other) { return other.handle == handle; });
}
std::string CConfigManager::getDefaultWorkspaceFor(const std::string& name) {
- for (auto other = m_vWorkspaceRules.begin(); other != m_vWorkspaceRules.end(); ++other) {
+ for (auto other = m_workspaceRules.begin(); other != m_workspaceRules.end(); ++other) {
if (other->isDefault) {
if (other->monitor == name)
return other->workspaceString;
@@ -1831,8 +1831,8 @@ std::string CConfigManager::getDefaultWorkspaceFor(const std::string& name) {
}
std::optional<std::string> CConfigManager::handleRawExec(const std::string& command, const std::string& args) {
- if (isFirstLaunch) {
- firstExecRequests.push_back({args, false});
+ if (m_isFirstLaunch) {
+ m_firstExecRequests.push_back({args, false});
return {};
}
@@ -1841,8 +1841,8 @@ std::optional<std::string> CConfigManager::handleRawExec(const std::string& comm
}
std::optional<std::string> CConfigManager::handleExec(const std::string& command, const std::string& args) {
- if (isFirstLaunch) {
- firstExecRequests.push_back({args, true});
+ if (m_isFirstLaunch) {
+ m_firstExecRequests.push_back({args, true});
return {};
}
@@ -1851,15 +1851,15 @@ std::optional<std::string> CConfigManager::handleExec(const std::string& command
}
std::optional<std::string> CConfigManager::handleExecOnce(const std::string& command, const std::string& args) {
- if (isFirstLaunch)
- firstExecRequests.push_back({args, true});
+ if (m_isFirstLaunch)
+ m_firstExecRequests.push_back({args, true});
return {};
}
std::optional<std::string> CConfigManager::handleExecRawOnce(const std::string& command, const std::string& args) {
- if (isFirstLaunch)
- firstExecRequests.push_back({args, false});
+ if (m_isFirstLaunch)
+ m_firstExecRequests.push_back({args, false});
return {};
}
@@ -1870,7 +1870,7 @@ std::optional<std::string> CConfigManager::handleExecShutdown(const std::string&
return {};
}
- finalExecRequests.push_back(args);
+ m_finalExecRequests.push_back(args);
return {};
}
@@ -1951,7 +1951,7 @@ std::optional<std::string> CConfigManager::handleMonitor(const std::string& comm
const auto TRANSFORM = (wl_output_transform)TSF;
// overwrite if exists
- for (auto& r : m_vMonitorRules) {
+ for (auto& r : m_monitorRules) {
if (r.name == newrule.name) {
r.transform = TRANSFORM;
return {};
@@ -1976,9 +1976,9 @@ std::optional<std::string> CConfigManager::handleMonitor(const std::string& comm
return "parse error: curitem bogus";
}
- std::erase_if(m_vMonitorRules, [&](const auto& other) { return other.name == newrule.name; });
+ std::erase_if(m_monitorRules, [&](const auto& other) { return other.name == newrule.name; });
- m_vMonitorRules.push_back(newrule);
+ m_monitorRules.push_back(newrule);
return {};
}
@@ -2016,7 +2016,7 @@ std::optional<std::string> CConfigManager::handleMonitor(const std::string& comm
if (ARGS[2].starts_with("auto")) {
newrule.offset = Vector2D(-INT32_MAX, -INT32_MAX);
// If this is the first monitor rule needs to be on the right.
- if (ARGS[2] == "auto-right" || ARGS[2] == "auto" || m_vMonitorRules.empty())
+ if (ARGS[2] == "auto-right" || ARGS[2] == "auto" || m_monitorRules.empty())
newrule.autoDir = eAutoDirs::DIR_AUTO_RIGHT;
else if (ARGS[2] == "auto-left")
newrule.autoDir = eAutoDirs::DIR_AUTO_LEFT;
@@ -2125,7 +2125,7 @@ std::optional<std::string> CConfigManager::handleMonitor(const std::string& comm
wsRule.workspaceId = id;
wsRule.workspaceName = name;
- m_vWorkspaceRules.emplace_back(wsRule);
+ m_workspaceRules.emplace_back(wsRule);
argno++;
} else {
Debug::log(ERR, "Config error: invalid monitor syntax at \"{}\"", ARGS[argno]);
@@ -2135,9 +2135,9 @@ std::optional<std::string> CConfigManager::handleMonitor(const std::string& comm
argno++;
}
- std::erase_if(m_vMonitorRules, [&](const auto& other) { return other.name == newrule.name; });
+ std::erase_if(m_monitorRules, [&](const auto& other) { return other.name == newrule.name; });
- m_vMonitorRules.push_back(newrule);
+ m_monitorRules.push_back(newrule);
if (error.empty())
return {};
@@ -2181,7 +2181,7 @@ std::optional<std::string> CConfigManager::handleAnimation(const std::string& co
// anim name
const auto ANIMNAME = ARGS[0];
- if (!m_AnimationTree.nodeExists(ANIMNAME))
+ if (!m_animationTree.nodeExists(ANIMNAME))
return "no such animation";
// This helper casts strings like "1", "true", "off", "yes"... to int.
@@ -2192,7 +2192,7 @@ std::optional<std::string> CConfigManager::handleAnimation(const std::string& co
return "invalid animation on/off state";
if (!enabledInt) {
- m_AnimationTree.setConfigForNode(ANIMNAME, enabledInt, 1, "default");
+ m_animationTree.setConfigForNode(ANIMNAME, enabledInt, 1, "default");
return {};
}
@@ -2212,10 +2212,10 @@ std::optional<std::string> CConfigManager::handleAnimation(const std::string& co
}
std::string bezierName = ARGS[3];
- m_AnimationTree.setConfigForNode(ANIMNAME, enabledInt, speed, ARGS[3], ARGS[4]);
+ m_animationTree.setConfigForNode(ANIMNAME, enabledInt, speed, ARGS[3], ARGS[4]);
if (!g_pAnimationManager->bezierExists(bezierName)) {
- const auto PANIMNODE = m_AnimationTree.getConfig(ANIMNAME);
+ const auto PANIMNODE = m_animationTree.getConfig(ANIMNAME);
PANIMNODE->internalBezier = "default";
return "no such bezier";
}
@@ -2356,13 +2356,13 @@ std::optional<std::string> CConfigManager::handleBind(const std::string& command
if ((KEY != "") || multiKey) {
SParsedKey parsedKey = parseKey(KEY);
- if (parsedKey.catchAll && m_szCurrentSubmap.empty()) {
+ if (parsedKey.catchAll && m_currentSubmap.empty()) {
Debug::log(ERR, "Catchall not allowed outside of submap!");
return "Invalid catchall, catchall keybinds are only allowed in submaps.";
}
g_pKeybindManager->addKeybind(SKeybind{parsedKey.key, KEYSYMS, parsedKey.keycode, parsedKey.catchAll, MOD, MODS, HANDLER,
- COMMAND, locked, m_szCurrentSubmap, DESCRIPTION, release, repeat, longPress,
+ COMMAND, locked, m_currentSubmap, DESCRIPTION, release, repeat, longPress,
mouse, nonConsuming, transparent, ignoreMods, multiKey, hasDescription, dontInhibit,
click, drag});
}
@@ -2521,7 +2521,7 @@ std::optional<std::string> CConfigManager::handleWindowRule(const std::string& c
rule->szContentType = extract(CONTENTTYPEPOS + 8);
if (RULE == "unset") {
- std::erase_if(m_vWindowRules, [&](const auto& other) {
+ std::erase_if(m_windowRules, [&](const auto& other) {
if (!other->v2)
return other->szClass == rule->szClass && !rule->szClass.empty();
else {
@@ -2574,9 +2574,9 @@ std::optional<std::string> CConfigManager::handleWindowRule(const std::string& c
}
if (RULE.starts_with("size") || RULE.starts_with("maxsize") || RULE.starts_with("minsize"))
- m_vWindowRules.insert(m_vWindowRules.begin(), rule);
+ m_windowRules.insert(m_windowRules.begin(), rule);
else
- m_vWindowRules.push_back(rule);
+ m_windowRules.push_back(rule);
return {};
}
@@ -2590,7 +2590,7 @@ std::optional<std::string> CConfigManager::handleLayerRule(const std::string& co
return "empty rule?";
if (RULE == "unset") {
- std::erase_if(m_vLayerRules, [&](const auto& other) { return other->targetNamespace == VALUE; });
+ std::erase_if(m_layerRules, [&](const auto& other) { return other->targetNamespace == VALUE; });
return {};
}
@@ -2603,7 +2603,7 @@ std::optional<std::string> CConfigManager::handleLayerRule(const std::string& co
rule->targetNamespaceRegex = {VALUE};
- m_vLayerRules.emplace_back(rule);
+ m_layerRules.emplace_back(rule);
for (auto const& m : g_pCompositor->m_vMonitors)
for (auto const& lsl : m->m_aLayerSurfaceLayers)
@@ -2636,12 +2636,12 @@ void CConfigManager::updateBlurredLS(const std::string& name, const bool forceBl
std::optional<std::string> CConfigManager::handleBlurLS(const std::string& command, const std::string& value) {
if (value.starts_with("remove,")) {
const auto TOREMOVE = trim(value.substr(7));
- if (std::erase_if(m_dBlurLSNamespaces, [&](const auto& other) { return other == TOREMOVE; }))
+ if (std::erase_if(m_blurLSNamespaces, [&](const auto& other) { return other == TOREMOVE; }))
updateBlurredLS(TOREMOVE, false);
return {};
}
- m_dBlurLSNamespaces.emplace_back(value);
+ m_blurLSNamespaces.emplace_back(value);
updateBlurredLS(value, true);
return {};
@@ -2756,10 +2756,10 @@ std::optional<std::string> CConfigManager::handleWorkspaceRules(const std::strin
wsRule.workspaceId = id;
wsRule.workspaceName = name;
- const auto IT = std::find_if(m_vWorkspaceRules.begin(), m_vWorkspaceRules.end(), [&](const auto& other) { return other.workspaceString == wsRule.workspaceString; });
+ const auto IT = std::find_if(m_workspaceRules.begin(), m_workspaceRules.end(), [&](const auto& other) { return other.workspaceString == wsRule.workspaceString; });
- if (IT == m_vWorkspaceRules.end())
- m_vWorkspaceRules.emplace_back(wsRule);
+ if (IT == m_workspaceRules.end())
+ m_workspaceRules.emplace_back(wsRule);
else
*IT = mergeWorkspaceRules(*IT, wsRule);
@@ -2768,9 +2768,9 @@ std::optional<std::string> CConfigManager::handleWorkspaceRules(const std::strin
std::optional<std::string> CConfigManager::handleSubmap(const std::string& command, const std::string& submap) {
if (submap == "reset")
- m_szCurrentSubmap = "";
+ m_currentSubmap = "";
else
- m_szCurrentSubmap = submap;
+ m_currentSubmap = submap;
return {};
}
@@ -2789,7 +2789,7 @@ std::optional<std::string> CConfigManager::handleSource(const std::string& comma
}
}};
- if (auto r = glob(absolutePath(rawpath, configCurrentPath).c_str(), GLOB_TILDE, nullptr, glob_buf.get()); r != 0) {
+ if (auto r = glob(absolutePath(rawpath, m_configCurrentPath).c_str(), GLOB_TILDE, nullptr, glob_buf.get()); r != 0) {
std::string err = std::format("source= globbing error: {}", r == GLOB_NOMATCH ? "found no match" : GLOB_ABORTED ? "read error" : "out of memory");
Debug::log(ERR, "{}", err);
return err;
@@ -2798,7 +2798,7 @@ std::optional<std::string> CConfigManager::handleSource(const std::string& comma
std::string errorsFromParsing;
for (size_t i = 0; i < glob_buf->gl_pathc; i++) {
- auto value = absolutePath(glob_buf->gl_pathv[i], configCurrentPath);
+ auto value = absolutePath(glob_buf->gl_pathv[i], m_configCurrentPath);
if (!std::filesystem::is_regular_file(value)) {
if (std::filesystem::exists(value)) {
@@ -2811,12 +2811,12 @@ std::optional<std::string> CConfigManager::handleSource(const std::string& comma
}
m_configPaths.emplace_back(value);
- auto configCurrentPathBackup = configCurrentPath;
- configCurrentPath = value;
+ auto configCurrentPathBackup = m_configCurrentPath;
+ m_configCurrentPath = value;
- const auto THISRESULT = m_pConfig->parseFile(value.c_str());
+ const auto THISRESULT = m_config->parseFile(value.c_str());
- configCurrentPath = configCurrentPathBackup;
+ m_configCurrentPath = configCurrentPathBackup;
if (THISRESULT.error && errorsFromParsing.empty())
errorsFromParsing += THISRESULT.getError();
@@ -2828,7 +2828,7 @@ std::optional<std::string> CConfigManager::handleSource(const std::string& comma
}
std::optional<std::string> CConfigManager::handleEnv(const std::string& command, const std::string& value) {
- if (!isFirstLaunch)
+ if (!m_isFirstLaunch)
return {};
const auto ARGS = CVarList(value, 2);
@@ -2854,10 +2854,10 @@ std::optional<std::string> CConfigManager::handleEnv(const std::string& command,
}
std::optional<std::string> CConfigManager::handlePlugin(const std::string& command, const std::string& path) {
- if (std::find(m_vDeclaredPlugins.begin(), m_vDeclaredPlugins.end(), path) != m_vDeclaredPlugins.end())
+ if (std::find(m_declaredPlugins.begin(), m_declaredPlugins.end(), path) != m_declaredPlugins.end())
return "plugin '" + path + "' declared twice";
- m_vDeclaredPlugins.push_back(path);
+ m_declaredPlugins.push_back(path);
return {};
}
@@ -2909,7 +2909,7 @@ std::string SConfigOptionDescription::jsonify() const {
auto parseData = [this]() -> std::string {
return std::visit(
[this](auto&& val) {
- const auto PTR = g_pConfigManager->m_pConfig->getConfigValuePtr(value.c_str());
+ const auto PTR = g_pConfigManager->m_config->getConfigValuePtr(value.c_str());
if (!PTR) {
Debug::log(ERR, "invalid SConfigOptionDescription: no config option {} exists", value);
return std::string{""};
@@ -3009,7 +3009,7 @@ std::string SConfigOptionDescription::jsonify() const {
}
void CConfigManager::ensurePersistentWorkspacesPresent() {
- g_pCompositor->ensurePersistentWorkspacesPresent(m_vWorkspaceRules);
+ g_pCompositor->ensurePersistentWorkspacesPresent(m_workspaceRules);
}
void CConfigManager::storeFloatingSize(PHLWINDOW window, const Vector2D& size) {
diff --git a/src/config/ConfigManager.hpp b/src/config/ConfigManager.hpp
index 50ab798c..574d861d 100644
--- a/src/config/ConfigManager.hpp
+++ b/src/config/ConfigManager.hpp
@@ -246,47 +246,47 @@ class CConfigManager {
std::optional<std::string> handlePlugin(const std::string&, const std::string&);
std::optional<std::string> handlePermission(const std::string&, const std::string&);
- std::string configCurrentPath;
+ std::string m_configCurrentPath;
- bool m_bWantsMonitorReload = false;
- bool m_bNoMonitorReload = false;
- bool isLaunchingExecOnce = false; // For exec-once to skip initial ws tracking
- bool m_bLastConfigVerificationWasSuccessful = true;
+ bool m_wantsMonitorReload = false;
+ bool m_noMonitorReload = false;
+ bool m_isLaunchingExecOnce = false; // For exec-once to skip initial ws tracking
+ bool m_lastConfigVerificationWasSuccessful = true;
void storeFloatingSize(PHLWINDOW window, const Vector2D& size);
std::optional<Vector2D> getStoredFloatingSize(PHLWINDOW window);
private:
- UP<Hyprlang::CConfig> m_pConfig;
+ UP<Hyprlang::CConfig> m_config;
std::vector<std::string> m_configPaths;
- Hyprutils::Animation::CAnimationConfigTree m_AnimationTree;
+ Hyprutils::Animation::CAnimationConfigTree m_animationTree;
- std::string m_szCurrentSubmap = ""; // For storing the current keybind submap
+ std::string m_currentSubmap = ""; // For storing the current keybind submap
- std::vector<SExecRequestedRule> execRequestedRules; // rules requested with exec, e.g. [workspace 2] kitty
+ std::vector<SExecRequestedRule> m_execRequestedRules; // rules requested with exec, e.g. [workspace 2] kitty
- std::vector<std::string> m_vDeclaredPlugins;
- std::vector<SPluginKeyword> pluginKeywords;
- std::vector<SPluginVariable> pluginVariables;
+ std::vector<std::string> m_declaredPlugins;
+ std::vector<SPluginKeyword> m_pluginKeywords;
+ std::vector<SPluginVariable> m_pluginVariables;
- bool isFirstLaunch = true; // For exec-once
+ bool m_isFirstLaunch = true; // For exec-once
- std::vector<SMonitorRule> m_vMonitorRules;
- std::vector<SWorkspaceRule> m_vWorkspaceRules;
- std::vector<SP<CWindowRule>> m_vWindowRules;
- std::vector<SP<CLayerRule>> m_vLayerRules;
- std::vector<std::string> m_dBlurLSNamespaces;
+ std::vector<SMonitorRule> m_monitorRules;
+ std::vector<SWorkspaceRule> m_workspaceRules;
+ std::vector<SP<CWindowRule>> m_windowRules;
+ std::vector<SP<CLayerRule>> m_layerRules;
+ std::vector<std::string> m_blurLSNamespaces;
- bool firstExecDispatched = false;
- bool m_bManualCrashInitiated = false;
+ bool m_firstExecDispatched = false;
+ bool m_manualCrashInitiated = false;
- std::vector<SFirstExecRequest> firstExecRequests; // bool is for if with rules
- std::vector<std::string> finalExecRequests;
+ std::vector<SFirstExecRequest> m_firstExecRequests; // bool is for if with rules
+ std::vector<std::string> m_finalExecRequests;
- std::vector<std::pair<std::string, std::string>> m_vFailedPluginConfigValues; // for plugin values of unloaded plugins
- std::string m_szConfigErrors = "";
+ std::vector<std::pair<std::string, std::string>> m_failedPluginConfigValues; // for plugin values of unloaded plugins
+ std::string m_configErrors = "";
uint32_t m_configValueNumber = 0;
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp
index 23385be8..bcd94830 100644
--- a/src/debug/HyprCtl.cpp
+++ b/src/debug/HyprCtl.cpp
@@ -341,10 +341,10 @@ static std::string getWorkspaceRuleData(const SWorkspaceRule& r, eHyprCtlOutputF
const std::string default_ = (bool)(r.isDefault) ? std::format(",\n \"default\": {}", boolToString(r.isDefault)) : "";
const std::string persistent = (bool)(r.isPersistent) ? std::format(",\n \"persistent\": {}", boolToString(r.isPersistent)) : "";
const std::string gapsIn = (bool)(r.gapsIn) ?
- std::format(",\n \"gapsIn\": [{}, {}, {}, {}]", r.gapsIn.value().top, r.gapsIn.value().right, r.gapsIn.value().bottom, r.gapsIn.value().left) :
+ std::format(",\n \"gapsIn\": [{}, {}, {}, {}]", r.gapsIn.value().m_top, r.gapsIn.value().m_right, r.gapsIn.value().m_bottom, r.gapsIn.value().m_left) :
"";
const std::string gapsOut = (bool)(r.gapsOut) ?
- std::format(",\n \"gapsOut\": [{}, {}, {}, {}]", r.gapsOut.value().top, r.gapsOut.value().right, r.gapsOut.value().bottom, r.gapsOut.value().left) :
+ std::format(",\n \"gapsOut\": [{}, {}, {}, {}]", r.gapsOut.value().m_top, r.gapsOut.value().m_right, r.gapsOut.value().m_bottom, r.gapsOut.value().m_left) :
"";
const std::string borderSize = (bool)(r.borderSize) ? std::format(",\n \"borderSize\": {}", r.borderSize.value()) : "";
const std::string border = (bool)(r.noBorder) ? std::format(",\n \"border\": {}", boolToString(!r.noBorder.value())) : "";
@@ -361,15 +361,15 @@ static std::string getWorkspaceRuleData(const SWorkspaceRule& r, eHyprCtlOutputF
return result;
} else {
- const std::string monitor = std::format("\tmonitor: {}\n", r.monitor.empty() ? "<unset>" : escapeJSONStrings(r.monitor));
- const std::string default_ = std::format("\tdefault: {}\n", (bool)(r.isDefault) ? boolToString(r.isDefault) : "<unset>");
- const std::string persistent = std::format("\tpersistent: {}\n", (bool)(r.isPersistent) ? boolToString(r.isPersistent) : "<unset>");
- const std::string gapsIn = (bool)(r.gapsIn) ? std::format("\tgapsIn: {} {} {} {}\n", std::to_string(r.gapsIn.value().top), std::to_string(r.gapsIn.value().right),
- std::to_string(r.gapsIn.value().bottom), std::to_string(r.gapsIn.value().left)) :
- std::format("\tgapsIn: <unset>\n");
- const std::string gapsOut = (bool)(r.gapsOut) ? std::format("\tgapsOut: {} {} {} {}\n", std::to_string(r.gapsOut.value().top), std::to_string(r.gapsOut.value().right),
- std::to_string(r.gapsOut.value().bottom), std::to_string(r.gapsOut.value().left)) :
- std::format("\tgapsOut: <unset>\n");
+ const std::string monitor = std::format("\tmonitor: {}\n", r.monitor.empty() ? "<unset>" : escapeJSONStrings(r.monitor));
+ const std::string default_ = std::format("\tdefault: {}\n", (bool)(r.isDefault) ? boolToString(r.isDefault) : "<unset>");
+ const std::string persistent = std::format("\tpersistent: {}\n", (bool)(r.isPersistent) ? boolToString(r.isPersistent) : "<unset>");
+ const std::string gapsIn = (bool)(r.gapsIn) ? std::format("\tgapsIn: {} {} {} {}\n", std::to_string(r.gapsIn.value().m_top), std::to_string(r.gapsIn.value().m_right),
+ std::to_string(r.gapsIn.value().m_bottom), std::to_string(r.gapsIn.value().m_left)) :
+ std::format("\tgapsIn: <unset>\n");
+ const std::string gapsOut = (bool)(r.gapsOut) ? std::format("\tgapsOut: {} {} {} {}\n", std::to_string(r.gapsOut.value().m_top), std::to_string(r.gapsOut.value().m_right),
+ std::to_string(r.gapsOut.value().m_bottom), std::to_string(r.gapsOut.value().m_left)) :
+ std::format("\tgapsOut: <unset>\n");
const std::string borderSize = std::format("\tborderSize: {}\n", (bool)(r.borderSize) ? std::to_string(r.borderSize.value()) : "<unset>");
const std::string border = std::format("\tborder: {}\n", (bool)(r.noBorder) ? boolToString(!r.noBorder.value()) : "<unset>");
const std::string rounding = std::format("\trounding: {}\n", (bool)(r.noRounding) ? boolToString(!r.noRounding.value()) : "<unset>");
@@ -1086,7 +1086,7 @@ static std::string dispatchKeyword(eHyprCtlOutputFormat format, std::string in)
// 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")
- g_pConfigManager->m_bWantsMonitorReload = true; // for monitor keywords
+ g_pConfigManager->m_wantsMonitorReload = true; // for monitor keywords
if (COMMAND.contains("input") || COMMAND.contains("device") || COMMAND == "source") {
g_pInputManager->setKeyboardLayout(); // update kb layout
@@ -1134,7 +1134,7 @@ static std::string reloadRequest(eHyprCtlOutputFormat format, std::string reques
const auto REQMODE = request.substr(request.find_last_of(' ') + 1);
if (REQMODE == "config-only")
- g_pConfigManager->m_bNoMonitorReload = true;
+ g_pConfigManager->m_noMonitorReload = true;
g_pConfigManager->reload();
@@ -1773,7 +1773,7 @@ std::string CHyprCtl::getReply(std::string request) {
return "unknown request";
if (reloadAll) {
- g_pConfigManager->m_bWantsMonitorReload = true; // for monitor keywords
+ g_pConfigManager->m_wantsMonitorReload = true; // for monitor keywords
g_pInputManager->setKeyboardLayout(); // update kb layout
g_pInputManager->setPointerConfigs(); // update mouse cfgs
@@ -1911,7 +1911,7 @@ static int hyprCtlFDTick(int fd, uint32_t mask, void* data) {
} else
close(ACCEPTEDCONNECTION);
- if (g_pConfigManager->m_bWantsMonitorReload)
+ if (g_pConfigManager->m_wantsMonitorReload)
g_pConfigManager->ensureMonitorStatus();
return 0;
diff --git a/src/desktop/Window.cpp b/src/desktop/Window.cpp
index 059453f4..ffe49498 100644
--- a/src/desktop/Window.cpp
+++ b/src/desktop/Window.cpp
@@ -697,24 +697,24 @@ void CWindow::applyDynamicRule(const SP<CWindowRule>& r) {
for (auto const& token : colorsAndAngles) {
// The first angle, or an explicit "0deg", splits the two gradients
if (active && token.contains("deg")) {
- activeBorderGradient.m_fAngle = std::stoi(token.substr(0, token.size() - 3)) * (PI / 180.0);
- active = false;
+ activeBorderGradient.m_angle = std::stoi(token.substr(0, token.size() - 3)) * (PI / 180.0);
+ active = false;
} else if (token.contains("deg"))
- inactiveBorderGradient.m_fAngle = std::stoi(token.substr(0, token.size() - 3)) * (PI / 180.0);
+ inactiveBorderGradient.m_angle = std::stoi(token.substr(0, token.size() - 3)) * (PI / 180.0);
else if (active)
- activeBorderGradient.m_vColors.push_back(configStringToInt(token).value_or(0));
+ activeBorderGradient.m_colors.push_back(configStringToInt(token).value_or(0));
else
- inactiveBorderGradient.m_vColors.push_back(configStringToInt(token).value_or(0));
+ inactiveBorderGradient.m_colors.push_back(configStringToInt(token).value_or(0));
}
activeBorderGradient.updateColorsOk();
// Includes sanity checks for the number of colors in each gradient
- if (activeBorderGradient.m_vColors.size() > 10 || inactiveBorderGradient.m_vColors.size() > 10)
+ if (activeBorderGradient.m_colors.size() > 10 || inactiveBorderGradient.m_colors.size() > 10)
Debug::log(WARN, "Bordercolor rule \"{}\" has more than 10 colors in one gradient, ignoring", r->szRule);
- else if (activeBorderGradient.m_vColors.empty())
+ else if (activeBorderGradient.m_colors.empty())
Debug::log(WARN, "Bordercolor rule \"{}\" has no colors, ignoring", r->szRule);
- else if (inactiveBorderGradient.m_vColors.empty())
+ else if (inactiveBorderGradient.m_colors.empty())
m_sWindowData.activeBorderColor = CWindowOverridableVar(activeBorderGradient, priority);
else {
m_sWindowData.activeBorderColor = CWindowOverridableVar(activeBorderGradient, priority);
diff --git a/src/devices/IKeyboard.cpp b/src/devices/IKeyboard.cpp
index 89891ebd..b8f9c7dd 100644
--- a/src/devices/IKeyboard.cpp
+++ b/src/devices/IKeyboard.cpp
@@ -81,7 +81,7 @@ void IKeyboard::setKeymap(const SStringRuleNames& rules) {
rules.options);
if (!xkbFilePath.empty()) {
- auto path = absolutePath(xkbFilePath, g_pConfigManager->configCurrentPath);
+ auto path = absolutePath(xkbFilePath, g_pConfigManager->m_configCurrentPath);
if (FILE* const KEYMAPFILE = fopen(path.c_str(), "r"); !KEYMAPFILE)
Debug::log(ERR, "Cannot open input:kb_file= file for reading");
diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp
index 197f19d3..6000dbf3 100644
--- a/src/helpers/Monitor.cpp
+++ b/src/helpers/Monitor.cpp
@@ -329,7 +329,7 @@ void CMonitor::onDisconnect(bool destroy) {
m->setMirror("");
}
- g_pConfigManager->m_bWantsMonitorReload = true;
+ g_pConfigManager->m_wantsMonitorReload = true;
}
listeners.frame.reset();
@@ -853,7 +853,7 @@ bool CMonitor::applyMonitorRule(SMonitorRule* pMonitorRule, bool force) {
g_pHyprRenderer->arrangeLayersForMonitor(ID);
// reload to fix mirrors
- g_pConfigManager->m_bWantsMonitorReload = true;
+ g_pConfigManager->m_wantsMonitorReload = true;
Debug::log(LOG, "Monitor {} data dump: res {:X}@{:.2f}Hz, scale {:.2f}, transform {}, pos {:X}, 10b {}", szName, vecPixelSize, refreshRate, scale, (int)transform, vecPosition,
(int)enabled10bit);
diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp
index 90cc2f6c..57d3df4a 100644
--- a/src/layout/DwindleLayout.cpp
+++ b/src/layout/DwindleLayout.cpp
@@ -155,9 +155,9 @@ void CHyprDwindleLayout::applyNodeDataToWindow(SDwindleNodeData* pNode, bool for
auto calcPos = PWINDOW->m_vPosition;
auto calcSize = PWINDOW->m_vSize;
- const auto OFFSETTOPLEFT = Vector2D((double)(DISPLAYLEFT ? gapsOut.left : gapsIn.left), (double)(DISPLAYTOP ? gapsOut.top : gapsIn.top));
+ const auto OFFSETTOPLEFT = Vector2D((double)(DISPLAYLEFT ? gapsOut.m_left : gapsIn.m_left), (double)(DISPLAYTOP ? gapsOut.m_top : gapsIn.m_top));
- const auto OFFSETBOTTOMRIGHT = Vector2D((double)(DISPLAYRIGHT ? gapsOut.right : gapsIn.right), (double)(DISPLAYBOTTOM ? gapsOut.bottom : gapsIn.bottom));
+ const auto OFFSETBOTTOMRIGHT = Vector2D((double)(DISPLAYRIGHT ? gapsOut.m_right : gapsIn.m_right), (double)(DISPLAYBOTTOM ? gapsOut.m_bottom : gapsIn.m_bottom));
calcPos = calcPos + OFFSETTOPLEFT;
calcSize = calcSize - OFFSETTOPLEFT - OFFSETBOTTOMRIGHT;
diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp
index a02e6aba..bac2c42e 100644
--- a/src/layout/MasterLayout.cpp
+++ b/src/layout/MasterLayout.cpp
@@ -674,9 +674,9 @@ void CHyprMasterLayout::applyNodeDataToWindow(SMasterNodeData* pNode) {
auto calcPos = PWINDOW->m_vPosition;
auto calcSize = PWINDOW->m_vSize;
- const auto OFFSETTOPLEFT = Vector2D((double)(DISPLAYLEFT ? gapsOut.left : gapsIn.left), (double)(DISPLAYTOP ? gapsOut.top : gapsIn.top));
+ const auto OFFSETTOPLEFT = Vector2D((double)(DISPLAYLEFT ? gapsOut.m_left : gapsIn.m_left), (double)(DISPLAYTOP ? gapsOut.m_top : gapsIn.m_top));
- const auto OFFSETBOTTOMRIGHT = Vector2D((double)(DISPLAYRIGHT ? gapsOut.right : gapsIn.right), (double)(DISPLAYBOTTOM ? gapsOut.bottom : gapsIn.bottom));
+ const auto OFFSETBOTTOMRIGHT = Vector2D((double)(DISPLAYRIGHT ? gapsOut.m_right : gapsIn.m_right), (double)(DISPLAYBOTTOM ? gapsOut.m_bottom : gapsIn.m_bottom));
calcPos = calcPos + OFFSETTOPLEFT;
calcSize = calcSize - OFFSETTOPLEFT - OFFSETBOTTOMRIGHT;
diff --git a/src/main.cpp b/src/main.cpp
index 397d7463..0cb5585e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -170,7 +170,7 @@ int main(int argc, char** argv) {
g_pCompositor->initServer(socketName, socketFd);
if (verifyConfig)
- return !g_pConfigManager->m_bLastConfigVerificationWasSuccessful;
+ return !g_pConfigManager->m_lastConfigVerificationWasSuccessful;
if (!envEnabled("HYPRLAND_NO_RT"))
NInit::gainRealTime();
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index a1ad846a..06ea358d 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -45,7 +45,7 @@ using namespace Hyprutils::OS;
static std::vector<std::pair<std::string, std::string>> getHyprlandLaunchEnv(PHLWORKSPACE pInitialWorkspace) {
static auto PINITIALWSTRACKING = CConfigValue<Hyprlang::INT>("misc:initial_workspace_tracking");
- if (!*PINITIALWSTRACKING || g_pConfigManager->isLaunchingExecOnce)
+ if (!*PINITIALWSTRACKING || g_pConfigManager->m_isLaunchingExecOnce)
return {};
const auto PMONITOR = g_pCompositor->m_pLastMonitor;
@@ -281,7 +281,7 @@ void CKeybindManager::updateXKBTranslationState() {
xkb_rule_names rules = {.rules = RULES.c_str(), .model = MODEL.c_str(), .layout = LAYOUT.c_str(), .variant = VARIANT.c_str(), .options = OPTIONS.c_str()};
const auto PCONTEXT = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
- FILE* const KEYMAPFILE = FILEPATH == "" ? nullptr : fopen(absolutePath(FILEPATH, g_pConfigManager->configCurrentPath).c_str(), "r");
+ FILE* const KEYMAPFILE = FILEPATH == "" ? nullptr : fopen(absolutePath(FILEPATH, g_pConfigManager->m_configCurrentPath).c_str(), "r");
auto PKEYMAP = KEYMAPFILE ? xkb_keymap_new_from_file(PCONTEXT, KEYMAPFILE, XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS) :
xkb_keymap_new_from_names(PCONTEXT, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS);
@@ -3203,16 +3203,16 @@ SDispatchResult CKeybindManager::setProp(std::string args) {
for (int i = 3; i < static_cast<int>(vars.size()); ++i) {
const auto TOKEN = vars[i];
if (TOKEN.ends_with("deg"))
- colorData.m_fAngle = std::stoi(TOKEN.substr(0, TOKEN.size() - 3)) * (PI / 180.0);
+ colorData.m_angle = std::stoi(TOKEN.substr(0, TOKEN.size() - 3)) * (PI / 180.0);
else
configStringToInt(TOKEN).and_then([&colorData](const auto& e) {
- colorData.m_vColors.push_back(e);
+ colorData.m_colors.push_back(e);
return std::invoke_result_t<decltype(::configStringToInt), const std::string&>(1);
});
}
} else if (VAL != "-1")
configStringToInt(VAL).and_then([&colorData](const auto& e) {
- colorData.m_vColors.push_back(e);
+ colorData.m_colors.push_back(e);
return std::invoke_result_t<decltype(::configStringToInt), const std::string&>(1);
});
diff --git a/src/managers/input/Touch.cpp b/src/managers/input/Touch.cpp
index 6b6cc376..c745eb9d 100644
--- a/src/managers/input/Touch.cpp
+++ b/src/managers/input/Touch.cpp
@@ -46,8 +46,8 @@ void CInputManager::onTouchDown(ITouch::SDownEvent e) {
const auto PWORKSPACE = PMONITOR->activeWorkspace;
const auto STYLE = PWORKSPACE->m_vRenderOffset->getStyle();
const bool VERTANIMS = STYLE == "slidevert" || STYLE.starts_with("slidefadevert");
- const double TARGETLEFT = ((VERTANIMS ? gapsOut.top : gapsOut.left) + *PBORDERSIZE) / (VERTANIMS ? PMONITOR->vecSize.y : PMONITOR->vecSize.x);
- const double TARGETRIGHT = 1 - (((VERTANIMS ? gapsOut.bottom : gapsOut.right) + *PBORDERSIZE) / (VERTANIMS ? PMONITOR->vecSize.y : PMONITOR->vecSize.x));
+ const double TARGETLEFT = ((VERTANIMS ? gapsOut.m_top : gapsOut.m_left) + *PBORDERSIZE) / (VERTANIMS ? PMONITOR->vecSize.y : PMONITOR->vecSize.x);
+ const double TARGETRIGHT = 1 - (((VERTANIMS ? gapsOut.m_bottom : gapsOut.m_right) + *PBORDERSIZE) / (VERTANIMS ? PMONITOR->vecSize.y : PMONITOR->vecSize.x));
const double POSITION = (VERTANIMS ? e.pos.y : e.pos.x);
if (POSITION < TARGETLEFT || POSITION > TARGETRIGHT) {
beginWorkspaceSwipe();
diff --git a/src/protocols/OutputManagement.cpp b/src/protocols/OutputManagement.cpp
index ecca0c48..49922b39 100644
--- a/src/protocols/OutputManagement.cpp
+++ b/src/protocols/OutputManagement.cpp
@@ -316,7 +316,7 @@ COutputConfiguration::COutputConfiguration(SP<CZwlrOutputConfigurationV1> resour
newState.enabled = false;
- g_pConfigManager->m_bWantsMonitorReload = true;
+ g_pConfigManager->m_wantsMonitorReload = true;
owner->monitorStates[PMONITOR->szName] = newState;
});
@@ -417,7 +417,7 @@ bool COutputConfiguration::applyTestConfiguration(bool test) {
// reset properties for next set.
head->state.committedProperties = 0;
- g_pConfigManager->m_bWantsMonitorReload = true;
+ g_pConfigManager->m_wantsMonitorReload = true;
owner->monitorStates[PMONITOR->szName] = newState;
}
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp
index 754f3ff9..4746f5b1 100644
--- a/src/render/OpenGL.cpp
+++ b/src/render/OpenGL.cpp
@@ -2344,9 +2344,9 @@ void CHyprOpenGLImpl::renderBorder(const CBox& box, const CGradientValueData& gr
glUniformMatrix3fv(m_shaders->m_shBORDER1.proj, 1, GL_FALSE, glMatrix.getMatrix().data());
#endif
- glUniform4fv(m_shaders->m_shBORDER1.gradient, grad.m_vColorsOkLabA.size() / 4, (float*)grad.m_vColorsOkLabA.data());
- glUniform1i(m_shaders->m_shBORDER1.gradientLength, grad.m_vColorsOkLabA.size() / 4);
- glUniform1f(m_shaders->m_shBORDER1.angle, (int)(grad.m_fAngle / (PI / 180.0)) % 360 * (PI / 180.0));
+ glUniform4fv(m_shaders->m_shBORDER1.gradient, grad.m_colorsOkLabA.size() / 4, (float*)grad.m_colorsOkLabA.data());
+ glUniform1i(m_shaders->m_shBORDER1.gradientLength, grad.m_colorsOkLabA.size() / 4);
+ glUniform1f(m_shaders->m_shBORDER1.angle, (int)(grad.m_angle / (PI / 180.0)) % 360 * (PI / 180.0));
glUniform1f(m_shaders->m_shBORDER1.alpha, a);
glUniform1i(m_shaders->m_shBORDER1.gradient2Length, 0);
@@ -2437,13 +2437,13 @@ void CHyprOpenGLImpl::renderBorder(const CBox& box, const CGradientValueData& gr
glUniformMatrix3fv(m_shaders->m_shBORDER1.proj, 1, GL_FALSE, glMatrix.getMatrix().data());
#endif
- glUniform4fv(m_shaders->m_shBORDER1.gradient, grad1.m_vColorsOkLabA.size() / 4, (float*)grad1.m_vColorsOkLabA.data());
- glUniform1i(m_shaders->m_shBORDER1.gradientLength, grad1.m_vColorsOkLabA.size() / 4);
- glUniform1f(m_shaders->m_shBORDER1.angle, (int)(grad1.m_fAngle / (PI / 180.0)) % 360 * (PI / 180.0));
- if (grad2.m_vColorsOkLabA.size() > 0)
- glUniform4fv(m_shaders->m_shBORDER1.gradient2, grad2.m_vColorsOkLabA.size() / 4, (float*)grad2.m_vColorsOkLabA.data());
- glUniform1i(m_shaders->m_shBORDER1.gradient2Length, grad2.m_vColorsOkLabA.size() / 4);
- glUniform1f(m_shaders->m_shBORDER1.angle2, (int)(grad2.m_fAngle / (PI / 180.0)) % 360 * (PI / 180.0));
+ glUniform4fv(m_shaders->m_shBORDER1.gradient, grad1.m_colorsOkLabA.size() / 4, (float*)grad1.m_colorsOkLabA.data());
+ glUniform1i(m_shaders->m_shBORDER1.gradientLength, grad1.m_colorsOkLabA.size() / 4);
+ glUniform1f(m_shaders->m_shBORDER1.angle, (int)(grad1.m_angle / (PI / 180.0)) % 360 * (PI / 180.0));
+ if (grad2.m_colorsOkLabA.size() > 0)
+ glUniform4fv(m_shaders->m_shBORDER1.gradient2, grad2.m_colorsOkLabA.size() / 4, (float*)grad2.m_colorsOkLabA.data());
+ glUniform1i(m_shaders->m_shBORDER1.gradient2Length, grad2.m_colorsOkLabA.size() / 4);
+ glUniform1f(m_shaders->m_shBORDER1.angle2, (int)(grad2.m_angle / (PI / 180.0)) % 360 * (PI / 180.0));
glUniform1f(m_shaders->m_shBORDER1.alpha, a);
glUniform1f(m_shaders->m_shBORDER1.gradientLerp, lerp);
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 4eee27ff..35f9ca3a 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -1186,7 +1186,7 @@ void CHyprRenderer::renderMonitor(PHLMONITOR pMonitor) {
g_pConfigManager->dispatchExecOnce(); // We exec-once when at least one monitor starts refreshing, meaning stuff has init'd
- if (g_pConfigManager->m_bWantsMonitorReload)
+ if (g_pConfigManager->m_wantsMonitorReload)
g_pConfigManager->performMonitorReload();
}
diff --git a/src/render/decorations/CHyprBorderDecoration.cpp b/src/render/decorations/CHyprBorderDecoration.cpp
index 7ff1ee10..54f6690e 100644
--- a/src/render/decorations/CHyprBorderDecoration.cpp
+++ b/src/render/decorations/CHyprBorderDecoration.cpp
@@ -61,13 +61,13 @@ void CHyprBorderDecoration::draw(PHLMONITOR pMonitor, float const& a) {
const bool ANIMATED = m_pWindow->m_fBorderFadeAnimationProgress->isBeingAnimated();
if (m_pWindow->m_fBorderAngleAnimationProgress->enabled()) {
- grad.m_fAngle += m_pWindow->m_fBorderAngleAnimationProgress->value() * M_PI * 2;
- grad.m_fAngle = normalizeAngleRad(grad.m_fAngle);
+ grad.m_angle += m_pWindow->m_fBorderAngleAnimationProgress->value() * M_PI * 2;
+ grad.m_angle = normalizeAngleRad(grad.m_angle);
// When borderangle is animated, it is counterintuitive to fade between inactive/active gradient angles.
// Instead we sync the angles to avoid fading between them and additionally rotating the border angle.
if (ANIMATED)
- m_pWindow->m_cRealBorderColorPrevious.m_fAngle = grad.m_fAngle;
+ m_pWindow->m_cRealBorderColorPrevious.m_angle = grad.m_angle;
}
int borderSize = m_pWindow->getRealBorderSize();
diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp
index 1f2211e0..8dff879b 100644
--- a/src/render/decorations/CHyprGroupBarDecoration.cpp
+++ b/src/render/decorations/CHyprGroupBarDecoration.cpp
@@ -151,7 +151,7 @@ void CHyprGroupBarDecoration::draw(PHLMONITOR pMonitor, float const& a) {
const auto* const PCOLACTIVE = GROUPLOCKED ? GROUPCOLACTIVELOCKED : GROUPCOLACTIVE;
const auto* const PCOLINACTIVE = GROUPLOCKED ? GROUPCOLINACTIVELOCKED : GROUPCOLINACTIVE;
- CHyprColor color = m_dwGroupMembers[WINDOWINDEX].lock() == g_pCompositor->m_pLastWindow.lock() ? PCOLACTIVE->m_vColors[0] : PCOLINACTIVE->m_vColors[0];
+ CHyprColor color = m_dwGroupMembers[WINDOWINDEX].lock() == g_pCompositor->m_pLastWindow.lock() ? PCOLACTIVE->m_colors[0] : PCOLINACTIVE->m_colors[0];
color.a *= a;
if (!rect.empty()) {
@@ -306,9 +306,9 @@ static void renderGradientTo(SP<CTexture> tex, CGradientValueData* grad) {
cairo_pattern_t* pattern;
pattern = cairo_pattern_create_linear(0, 0, 0, bufferSize.y);
- for (unsigned long i = 0; i < grad->m_vColors.size(); i++) {
- cairo_pattern_add_color_stop_rgba(pattern, 1 - (double)(i + 1) / (grad->m_vColors.size() + 1), grad->m_vColors[i].r, grad->m_vColors[i].g, grad->m_vColors[i].b,
- grad->m_vColors[i].a);
+ for (unsigned long i = 0; i < grad->m_colors.size(); i++) {
+ cairo_pattern_add_color_stop_rgba(pattern, 1 - (double)(i + 1) / (grad->m_colors.size() + 1), grad->m_colors[i].r, grad->m_colors[i].g, grad->m_colors[i].b,
+ grad->m_colors[i].a);
}
cairo_rectangle(CAIRO, 0, 0, bufferSize.x, bufferSize.y);