summaryrefslogtreecommitdiff
path: root/src/config
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-06-04 02:48:56 +0800
committerGitHub <noreply@github.com>2025-06-03 19:48:56 +0100
commitb5c0d0b8aa8bb095ac447bf6c73486cb1c172b6e (patch)
tree0d59fadeacd86a45bb1ecdae36acd3aa59f9daf3 /src/config
parentb1d0a727cc594e5329c5971d73391c7529e1c80e (diff)
keybinds: add an option to respect gaps out for floating to movewindow (#9360)
Diffstat (limited to 'src/config')
-rw-r--r--src/config/ConfigDescriptions.hpp7
-rw-r--r--src/config/ConfigManager.cpp3
-rw-r--r--src/config/ConfigManager.hpp1
3 files changed, 11 insertions, 0 deletions
diff --git a/src/config/ConfigDescriptions.hpp b/src/config/ConfigDescriptions.hpp
index a77cf757..98214284 100644
--- a/src/config/ConfigDescriptions.hpp
+++ b/src/config/ConfigDescriptions.hpp
@@ -33,6 +33,13 @@ inline static const std::vector<SConfigOptionDescription> CONFIG_OPTIONS = {
.data = SConfigOptionDescription::SStringData{"20"},
},
SConfigOptionDescription{
+ .value = "general:float_gaps",
+ .description = "gaps between windows and monitor edges for floating windows\n\nsupports css style gaps (top, right, bottom, left -> 5 10 15 20). \n-1 means default "
+ "gaps_in/gaps_out\n0 means no gaps",
+ .type = CONFIG_OPTION_STRING_SHORT,
+ .data = SConfigOptionDescription::SStringData{"0"},
+ },
+ SConfigOptionDescription{
.value = "general:gaps_workspaces",
.description = "gaps between workspaces. Stacks with gaps_out.",
.type = CONFIG_OPTION_INT,
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index 8dce9f30..e2fb26ab 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -444,6 +444,7 @@ CConfigManager::CConfigManager() {
registerConfigVar("general:no_border_on_floating", Hyprlang::INT{0});
registerConfigVar("general:gaps_in", Hyprlang::CConfigCustomValueType{configHandleGapSet, configHandleGapDestroy, "5"});
registerConfigVar("general:gaps_out", Hyprlang::CConfigCustomValueType{configHandleGapSet, configHandleGapDestroy, "20"});
+ registerConfigVar("general:float_gaps", Hyprlang::CConfigCustomValueType{configHandleGapSet, configHandleGapDestroy, "0"});
registerConfigVar("general:gaps_workspaces", Hyprlang::INT{0});
registerConfigVar("general:no_focus_fallback", Hyprlang::INT{0});
registerConfigVar("general:resize_on_border", Hyprlang::INT{0});
@@ -1318,6 +1319,8 @@ SWorkspaceRule CConfigManager::mergeWorkspaceRules(const SWorkspaceRule& rule1,
mergedRule.gapsIn = rule2.gapsIn;
if (rule2.gapsOut.has_value())
mergedRule.gapsOut = rule2.gapsOut;
+ if (rule2.floatGaps)
+ mergedRule.floatGaps = rule2.floatGaps;
if (rule2.borderSize.has_value())
mergedRule.borderSize = rule2.borderSize;
if (rule2.noBorder.has_value())
diff --git a/src/config/ConfigManager.hpp b/src/config/ConfigManager.hpp
index 5cb95bac..134292e5 100644
--- a/src/config/ConfigManager.hpp
+++ b/src/config/ConfigManager.hpp
@@ -36,6 +36,7 @@ struct SWorkspaceRule {
bool isPersistent = false;
std::optional<CCssGapData> gapsIn;
std::optional<CCssGapData> gapsOut;
+ std::optional<CCssGapData> floatGaps = gapsOut;
std::optional<int64_t> borderSize;
std::optional<bool> decorate;
std::optional<bool> noRounding;