From c949173bc9c9f9e8276cba098cb82ed51ad4965b Mon Sep 17 00:00:00 2001 From: levnikmyskin Date: Mon, 1 May 2023 23:28:27 +0200 Subject: 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 Co-authored-by: vaxerski <43317083+vaxerski@users.noreply.github.com> --- src/config/ConfigManager.hpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/config/ConfigManager.hpp') 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 #include #include +#include #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 gapsIn; + std::optional gapsOut; + std::optional borderSize; + std::optional border; + std::optional rounding; + std::optional 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 m_dMonitorRules; - std::unordered_map m_mDefaultWorkspaces; + std::unordered_map m_mWorkspaceRules; std::deque m_dWindowRules; std::deque m_dLayerRules; std::deque 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&); -- cgit v1.2.3