* add snapping to floating windows
Works for both moving and resizing of windows.
It comes with 3 options:
`general:snap:enabled` - whether it's enabled, off by default
`general:snap:window_gap` - minimum gap in pixels between windows before
snapping. Setting to 0 effectively turns off this method of snapping.
`general:snap:monitor_gap` - minimum gap in pixels between window and
monitor edges before snapping. Again, setting it to 0 effectively turns
it off.
* snap: add more ignore criteria and change if clause into a guard
* snap: refactor code
* snap: new refactoring approach and account for border size
* snap: do corner snapping after all edge snapping is done
The approach of performing corner snaps after each individual edge snap
results in far fewer scenarios where snapping can occur.
After trying it out for a while, I found that I prefer an approach
that's more prone to snapping.
* snap: combine snapWindows and snapMonitor into a single function
* snap: add forced aspect ratio functionality
* snap: avoid directly referring to border_size config value
* snap: address vaxerski feedback
- add new line between functions
- use std::function typedef for SnapFn and make snap functions static
- avoid uninitialized variable declarations.
- change ignore condition m_bIsX11 to isX11OverrideRedirect()
- use braces for CBox and Vector2D declarations.
- add SNAP_INVALID to eSnapEdge enum
- use bitshift notation for eSnapEdge and eRectCorner
- make performSnap a non-member function.
* snap: add corner-snapping to forced aspect ratio mode
If `default_split_ratio` is greater than 1.0, `split_bias` will give the
bigger half to a specific window:
0 - positional (default)
1 - current window
2 - opening window
ref https://github.com/hyprwm/xdg-desktop-portal-hyprland/issues/251
if the XDG_CURRENT_DESKTOP is externally managed (e.g. DE, DM, etc) Hyprland will not overwrite it. In those cases, if that's undesired, portals and other apps depending on it might break.
* config: add xwayland enabled option to config
* xwayland: use DISPLAY env variable for enable/disable of new launches
* xwayland: close X11 windows when turning of XWayland
* clang: format fix
* config: add better description for xwayland:enabled
* xwayland: close X11 windows on disable without crashes
* xwayland: better method of informing CXWayland if xwayland enabled
* xwayland: prevent closing non-xwayland windows on disable
* misc: loop formatting
* keybindmgr: fix typo in swap prev
seems a suspicious extra ) got added, remove it.
* configmgr: dont dereference invalid iterator
i think the idea here was to print the key and not the iterator at or
past .end()
cursor:sync_gsettings_theme is set to default true and if enabled it
will now sync xcursor theme loading with gsettings if it can, meaning
CSD clients will now also change to the appropiate theme upon start and
hyprctl setcursor THEME SIZE .
* framebuffer: avoid gluint overflow
GLuint was being initialized to -1 and rolling over to unsigned int max,
its defined behaviour but very unnecessery. add a bool and use it for
checking if allocated or not.
* opengl: avoid gluint rollover
-1 rolls over to unsigned int max, use 0xFF instead.
* core: big uint64_t to int type conversion
there were a few uint64_t to int implicit conversions overflowing int
and causing UB, make all monitor/workspaces/windows use the new
typedefs. also fix the various related 64 to 32 implicit conversions
going around found with -Wshorten-64-to-32
* fix: change min cursor padding to 0
* chore: set default hotspot padding to 0
* fix: adjusting clamp after getting closest point to fix getting off limit point
* fix: deal with floating point to clamp to prev value
* refactor: max coords to vector
* fix: remove box closestPoint adjustment due its fix on hyprutils
* input: add cursor:warp_on_changeworkspace
If enabled, warp the cursor to the last focused window on the workspace in the `changeworkspace' dispatcher, except if the cursor is currently on the WLR top layer.
Respect persistent warps.
* warp_on_change_workspace: check if focused layer is a window.
* ## Open window relative to active window
`new_on_active`:
- `none` (default):
- `before`: above of the focused window
- `after`: below the focused window
If the focused window is the solo master window, or the new window replaces master, this option has no effect and new_on_top are respected.
## Refine new window status control
**BREAKING CHANGE**: new_is_master removed in favour of new variable
`new_status`:
- `slave` (default): new window open as slave
- `master`: new window open as master
- `inherit`: new window inherit status from active window, i.e. when the focused window is master, new window will become new master, otherwise new window are added to slaves
* refactor: rename a few variables