diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2026-03-20 13:52:37 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-20 17:52:37 +0000 |
| commit | 8726a7363eb9213235e6e23657668e0daac39a5b (patch) | |
| tree | 42eeb40f6f81a9ccec1455f308e56173e9dcce4b /src/layout/target/WindowTarget.cpp | |
| parent | b940b0d2c197841b0f648598ee782dbaf9e0a89b (diff) | |
config: cleanup the entire config infrastructure (#13785)
Massively refactors the config infrastructure, sorely
needed and will be req'd for the lua stuff
Diffstat (limited to 'src/layout/target/WindowTarget.cpp')
| -rw-r--r-- | src/layout/target/WindowTarget.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/layout/target/WindowTarget.cpp b/src/layout/target/WindowTarget.cpp index bd94a8c9..3bc36c2a 100644 --- a/src/layout/target/WindowTarget.cpp +++ b/src/layout/target/WindowTarget.cpp @@ -4,11 +4,12 @@ #include "../algorithm/Algorithm.hpp" #include "../../protocols/core/Compositor.hpp" -#include "../../config/ConfigManager.hpp" +#include "../../config/shared/workspace/WorkspaceRuleManager.hpp" #include "../../helpers/Monitor.hpp" #include "../../xwayland/XSurface.hpp" #include "../../Compositor.hpp" #include "../../render/Renderer.hpp" +#include "../../desktop/state/FloatState.hpp" #include <hyprutils/utils/ScopeGuard.hpp> @@ -71,7 +72,7 @@ void CWindowTarget::updatePos() { // get specific gaps and rules for this workspace, // if user specified them in config - const auto WORKSPACERULE = g_pConfigManager->getWorkspaceRuleFor(PWORKSPACE); + const auto WORKSPACERULE = Config::workspaceRuleMgr()->getWorkspaceRuleFor(PWORKSPACE); if (!validMapped(m_window)) { if (m_window) @@ -107,8 +108,8 @@ void CWindowTarget::updatePos() { const bool DISPLAYINVERSERIGHT = STICKS(m_box.logicalBox.x + m_box.logicalBox.w, MONITOR_WORKAREA.x); static auto PGAPSINDATA = CConfigValue<Hyprlang::CUSTOMTYPE>("general:gaps_in"); - auto* const PGAPSIN = sc<CCssGapData*>((PGAPSINDATA.ptr())->getData()); - auto gapsIn = WORKSPACERULE.gapsIn.value_or(*PGAPSIN); + auto* const PGAPSIN = sc<Config::CCssGapData*>((PGAPSINDATA.ptr())->getData()); + auto gapsIn = (WORKSPACERULE && WORKSPACERULE->m_gapsIn.has_value()) ? WORKSPACERULE->m_gapsIn.value() : *PGAPSIN; const static auto REQUESTEDRATIO = CConfigValue<Hyprlang::VEC2>("layout:single_window_aspect_ratio"); const static auto REQUESTEDRATIOTOLERANCE = CConfigValue<Hyprlang::FLOAT>("layout:single_window_aspect_ratio_tolerance"); @@ -264,7 +265,7 @@ std::expected<SGeometryRequested, eGeometryFailure> CWindowTarget::desiredGeomet DESIRED_GEOM.y = xy.y; } - const auto STOREDSIZE = m_window->m_ruleApplicator->persistentSize().valueOrDefault() ? g_pConfigManager->getStoredFloatingSize(m_window.lock()) : std::nullopt; + const auto STOREDSIZE = m_window->m_ruleApplicator->persistentSize().valueOrDefault() ? Desktop::floatState()->get(m_window.lock()) : std::nullopt; if (STOREDSIZE) requested.size = clampSizeForDesired(*STOREDSIZE); |
