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.
This commit is contained in:
parent
7c7a84ff60
commit
93b4478e70
3 changed files with 89 additions and 79 deletions
|
|
@ -344,6 +344,7 @@ CConfigManager::CConfigManager() {
|
|||
m_pConfig->addConfigValue("general:snap:enabled", Hyprlang::INT{0});
|
||||
m_pConfig->addConfigValue("general:snap:window_gap", Hyprlang::INT{10});
|
||||
m_pConfig->addConfigValue("general:snap:monitor_gap", Hyprlang::INT{10});
|
||||
m_pConfig->addConfigValue("general:snap:border_overlap", Hyprlang::INT{0});
|
||||
|
||||
m_pConfig->addConfigValue("misc:disable_hyprland_logo", Hyprlang::INT{0});
|
||||
m_pConfig->addConfigValue("misc:disable_splash_rendering", Hyprlang::INT{0});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue