aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/config/ConfigDescriptions.hpp
diff options
context:
space:
mode:
authorMike Will <[email protected]>2024-10-31 07:21:08 -0400
committerGitHub <[email protected]>2024-10-31 11:21:08 +0000
commit93b4478e70af6ffb08a4a66a6d0364c3296db296 (patch)
treee7c905de8431bdfaccaa94553623331aecdf0501 /src/config/ConfigDescriptions.hpp
parent7c7a84ff60f8c1e00c6a0de3f7656f0bbd933d56 (diff)
downloadHyprland-93b4478e70af6ffb08a4a66a6d0364c3296db296.tar.gz
Hyprland-93b4478e70af6ffb08a4a66a6d0364c3296db296.zip
snap: add option `border_overlap` and other improvements (#8289)
* snap: add option `border_overlap` and other improvements I really liked the way borders used to overlap when snapping and how only the window's main surface would snap to the monitor, so I would like to bring that behavior back, but in the form of a config option. Other improvements include: - reduced the number of snap functions from 4 down to 2, and only one ever gets called at any given time. - border size should not be added to gap size. It seemed like the right thing to do at the time, but it makes snapping feel way stronger than it actually should. - all const variables have been given the all-caps naming convention. - to avoid excessive casting, border size is declared as a double. - to avoid excessive x + w, y + h calculations. I'm using a struct called Range and working only with start and end values until the very end of the function. - check for both monitor snapping as well as reserved monitor space snapping in a relatively efficient way. * snap: always border-align for corners and reserved monitor space We probably don't want to treat reserved monitor space as if it were just a smaller monitor. Instead, it should be treated more like a borderless window, which means our window's border should never encroach upon it.
Diffstat (limited to 'src/config/ConfigDescriptions.hpp')
-rw-r--r--src/config/ConfigDescriptions.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/config/ConfigDescriptions.hpp b/src/config/ConfigDescriptions.hpp
index 0177f92b..07034e71 100644
--- a/src/config/ConfigDescriptions.hpp
+++ b/src/config/ConfigDescriptions.hpp
@@ -122,6 +122,12 @@ inline static const std::vector<SConfigOptionDescription> CONFIG_OPTIONS = {
.type = CONFIG_OPTION_INT,
.data = SConfigOptionDescription::SRangeData{10, 0, 100},
},
+ SConfigOptionDescription{
+ .value = "general:snap:border_overlap",
+ .description = "if true, windows snap such that only one border's worth of space is between them",
+ .type = CONFIG_OPTION_BOOL,
+ .data = SConfigOptionDescription::SBoolData{false},
+ },
/*
* decoration: