diff options
| author | levnikmyskin <ale.sleeper@gmail.com> | 2023-05-01 23:28:27 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-01 22:28:27 +0100 |
| commit | c949173bc9c9f9e8276cba098cb82ed51ad4965b (patch) | |
| tree | d66c874c988a1229d237fb1818957c0d68a81ab4 /src/config/ConfigManager.hpp | |
| parent | 250d5cf78c191c51c327f6df219fba4ac3ed1a85 (diff) | |
Added some workspace-specific rules (#1986)
* added some workspace-specific rules
* added some worskpace-specific rules, with windowrule like syntax
* monitor is not mandatory anymore
* pointers to config are now static
* fixed optional WorkspaceRule fields
* Windows can now specify border size
* removed CHyprOpenGLImpl::renderBorder borderSize default value
* stuff
---------
Co-authored-by: Alessio Molinari <alessiomolinari@gmail.com>
Co-authored-by: vaxerski <43317083+vaxerski@users.noreply.github.com>
Diffstat (limited to 'src/config/ConfigManager.hpp')
| -rw-r--r-- | src/config/ConfigManager.hpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/config/ConfigManager.hpp b/src/config/ConfigManager.hpp index 0d4d6cd7..b18cbf1a 100644 --- a/src/config/ConfigManager.hpp +++ b/src/config/ConfigManager.hpp @@ -10,6 +10,7 @@ #include <deque> #include <algorithm> #include <regex> +#include <optional> #include "../Window.hpp" #include "../helpers/WLClasses.hpp" @@ -45,6 +46,19 @@ struct SMonitorRule { bool enable10bit = false; }; +struct SWorkspaceRule { + std::string monitor = ""; + std::string workspaceString = ""; + std::string workspaceName = ""; + int workspaceId = -1; + std::optional<int64_t> gapsIn; + std::optional<int64_t> gapsOut; + std::optional<int64_t> borderSize; + std::optional<int> border; + std::optional<int> rounding; + std::optional<int> decorate; +}; + struct SMonitorAdditionalReservedArea { int top = 0; int bottom = 0; @@ -149,6 +163,7 @@ class CConfigManager { SConfigValue* getConfigValuePtrSafe(const std::string&); SMonitorRule getMonitorRuleFor(const std::string&, const std::string& displayName = ""); + SWorkspaceRule getWorkspaceRuleFor(CWorkspace*); std::string getDefaultWorkspaceFor(const std::string&); CMonitor* getBoundMonitorForWS(const std::string&); @@ -211,7 +226,7 @@ class CConfigManager { bool isFirstLaunch = true; // For exec-once std::deque<SMonitorRule> m_dMonitorRules; - std::unordered_map<std::string, std::string> m_mDefaultWorkspaces; + std::unordered_map<int, SWorkspaceRule> m_mWorkspaceRules; std::deque<SWindowRule> m_dWindowRules; std::deque<SLayerRule> m_dLayerRules; std::deque<std::string> m_dBlurLSNamespaces; @@ -245,7 +260,7 @@ class CConfigManager { void handleWindowRule(const std::string&, const std::string&); void handleLayerRule(const std::string&, const std::string&); void handleWindowRuleV2(const std::string&, const std::string&); - void handleDefaultWorkspace(const std::string&, const std::string&); + void handleWorkspaceRules(const std::string&, const std::string&); void handleBezier(const std::string&, const std::string&); void handleAnimation(const std::string&, const std::string&); void handleSource(const std::string&, const std::string&); |
