Commit graph

636 commits

Author SHA1 Message Date
d1638a09ba shadow: add sharp and refactor options
options moved to decoration:shadow:
2024-11-05 15:44:40 +00:00
88e9e03945 renderer: add expand_undersized_textures
adds an option to disable the texture expansion for textures that are smaller while resizing up
2024-11-04 19:45:23 +00:00
Ikalco
c4d214c42d
monitors: fix vrr breaking monitor disconnect (#8314) 2024-11-01 12:30:26 +00:00
Mike Will
93b4478e70
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.
2024-10-31 11:21:08 +00:00
3dd8db83f1 pointer: add default auto for no_hw_cursors
auto defaults to off on nvidia, on for everyone else. Gotta wait until we do fucking drm_dumb and it fucking works
2024-10-26 02:12:43 +01:00
d5689bb539 internal: cleanup CMonitor usage and fix a few ref hogs
ref #8221
2024-10-26 02:06:13 +01:00
Aqa-Ib
2b6ff6837e
groups: add group_on_movetoworkspace (#8159) 2024-10-23 00:51:25 +01:00
Mike Will
4093b993a2
input: add snapping to floating windows (#8088)
* 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
2024-10-21 16:08:25 +01:00
Vaxry
f044e4c951
internal: Move CMonitor to SP (#8178)
* move monitors to sp

* XD
2024-10-19 23:03:29 +01:00
Maximilian Seidler
e5d3a71263
config: fix generateConfig loop (#8164)
* config: fix generateConfig loop

* config: cleanup getMainConfigPath
2024-10-19 15:49:56 +01:00
Vaxry
d655a10381
config/layout: nuke no_gaps_when_only (#8072) 2024-10-11 10:56:19 +01:00
Aqa-Ib
6ae89940c7
layout: add merge_floated_into_tiled_on_groupbar (#8042) 2024-10-09 10:58:49 +01:00
Aqa-Ib
45e82199fb
layout: add drag_into_group to control merging dragging windows (#8004) 2024-10-08 11:20:41 +01:00
4711796d38 config: give simple help for super+q not working
only on default config :P
2024-10-08 09:54:25 +01:00
Aqa-Ib
e2426942e5
layout: add auto_group to control default grouping (#7883) 2024-10-02 10:22:19 +01:00
Mike Will
2cf6e7862a
dwindle: add config option split_bias (#7920)
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
2024-09-28 01:49:40 +01:00
Vaxry
caaa9b11e4
wlr-output-configuration: Improve output configuration (#7571) 2024-09-26 11:10:53 +01:00
Artur Manuel
508bde1f61
core: add HYPRLAND_CONFIG environment variable (#7851) 2024-09-23 16:40:19 +01:00
883d01084c userchecks: add an xdg_current_desktop check
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.
2024-09-18 11:22:12 +01:00
darkwater
04421063af
config: add order rule for layers (#7697) 2024-09-09 10:10:08 +01:00
trianta
70add904c4
config: add exec-shutdown for running commands on shutdown (#7683)
* config: add exec-shutdown for running commands on shutdown

* compositor: delay stopping until after exec-shutdown
2024-09-07 20:54:33 +01:00
Parola Marco
4a42c5ed20
config: Add a variable to prevent groups from merging after being dragged (#7650)
* config: Add a variable to prevent groups from merging after being dragged

* Fixed code style for [f777f028]
2024-09-05 17:29:33 +01:00
trianta
bd6d6e7f33
xwayland: add option to enable/disable xwayland (#7633)
* 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
2024-09-05 17:26:46 +01:00
Vaxry
c5fd577181
config: Add a window rule to render while unfocused (#7582) 2024-08-30 17:37:52 +02:00
Tom Englund
72c7818ae6
misc: constify the remaining for loops (#7534)
now we roll loops at blazing constified speed.
2024-08-26 20:24:30 +02:00
Tom Englund
1ea47950f4
misc: fix some minor typos (#7530)
* 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()
2024-08-26 18:02:44 +02:00
Tom Englund
8d6c18076f
core: make most for loops use const references (#7527)
why not let the compiler optimise things for us at hyprspeeds when we
can.
2024-08-26 17:25:39 +02:00
82c67e61a9 config: fix uninitialized values with mode parsing 2024-08-24 15:24:55 +02:00
Sungyoon Cho
688fe5c147
windowrules: add fullscreenstate field (#7466)
* windowrules: add fullscreenstate field

* fix typo
2024-08-23 20:42:14 +01:00
883463f9dd animations: add workspace in/out configs 2024-08-21 14:38:07 +02:00
ParaN3xus
946ed1f32a
core: add option to control which window to focus on close (#7368) 2024-08-21 11:24:42 +01:00
Vaxry
92744b5b9a
IPC: Add config descriptions (#7377)
Thanks @gulafaran for the work

---

Co-authored-by: @gulafaran
2024-08-17 17:33:16 +01:00
Ikalco
d361fcbd85
config: fix explicit sync option warning (#7293) 2024-08-12 17:16:00 +01:00
Walt Bringenberg
01ff5fdf6a
cursor: make inactive_timeout setting a float (#7268) 2024-08-10 21:42:45 +01:00
Tom Englund
8b37e81374
cursormgr: add a new setting to sync gsettings (#7253)
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 .
2024-08-09 19:33:20 +02:00
Tom Englund
4b4971c06f
internal: introduce new types to avoid unsigned int rollover and signed int overflow (#7216)
* 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
2024-08-08 21:01:50 +02:00
Vaxry
640d161851
renderer: Explicit sync fixes (#7151)
Enables explicit sync by default for most platforms

`misc:no_direct_scanout` -> `render:direct_scanout`
2024-08-06 15:52:19 +02:00
MightyPlaza
e989a0bcff
internal: refactor fullscreen states (#7104)
* refactor fullscreen
modified:   src/Compositor.cpp
modified:   src/Compositor.hpp
modified:   src/config/ConfigManager.cpp
modified:   src/config/ConfigManager.hpp
modified:   src/debug/HyprCtl.cpp
modified:   src/desktop/LayerSurface.cpp
modified:   src/desktop/Window.cpp
modified:   src/desktop/Window.hpp
modified:   src/desktop/Workspace.cpp
modified:   src/desktop/Workspace.hpp
modified:   src/events/Windows.cpp
modified:   src/helpers/Monitor.cpp
modified:   src/layout/DwindleLayout.cpp
modified:   src/layout/DwindleLayout.hpp
modified:   src/layout/IHyprLayout.cpp
modified:   src/layout/IHyprLayout.hpp
modified:   src/layout/MasterLayout.cpp
modified:   src/layout/MasterLayout.hpp
modified:   src/managers/KeybindManager.cpp
modified:   src/managers/KeybindManager.hpp
modified:   src/managers/input/IdleInhibitor.cpp
modified:   src/managers/input/InputManager.cpp
modified:   src/managers/input/Swipe.cpp
modified:   src/protocols/ForeignToplevelWlr.cpp
modified:   src/render/Renderer.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp

* clean up
modified:   src/config/ConfigManager.cpp
modified:   src/debug/HyprCtl.cpp
modified:   src/desktop/Window.hpp
modified:   src/desktop/Workspace.cpp
modified:   src/events/Windows.cpp
modified:   src/managers/KeybindManager.cpp
modified:   src/managers/input/Swipe.cpp

* fix mapWindow fullscreen
modified:   src/events/Windows.cpp

* fix typo
modified:   src/desktop/Workspace.cpp

* add fullscreenstate
modified:   src/config/ConfigManager.cpp
modified:   src/events/Windows.cpp

* change syncFullscreen to lower
modified:   src/config/ConfigManager.hpp

* initialize fs state
modified:   src/desktop/Window.hpp
2024-07-31 19:55:52 +02:00
ae638d997d configmgr: fix warning 2024-07-27 18:15:47 +02:00
33a5c8ce32 config: avoid using initial ws tracking for exec-once 2024-07-25 15:29:39 +02:00
MightyPlaza
72bce7efd5
keybinds: add bindp and noshortcutsinhibit (#7017) 2024-07-24 14:10:36 +02:00
khachbe
cf373d315e
touch: add touch swipe invert config (#6940) 2024-07-21 13:59:09 +02:00
Vaxry
016da234d0
Core: Move to aquamarine (#6608)
Moves Hyprland from wlroots to aquamarine for the backend.

---------

Signed-off-by: Vaxry <vaxry@vaxry.net>
Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
Co-authored-by: Jan Beich <jbeich@FreeBSD.org>
Co-authored-by: vaxerski <vaxerski@users.noreply.github.com>
Co-authored-by: UjinT34 <41110182+UjinT34@users.noreply.github.com>
Co-authored-by: Tom Englund <tomenglund26@gmail.com>
Co-authored-by: Ikalco <73481042+ikalco@users.noreply.github.com>
Co-authored-by: diniamo <diniamo53@gmail.com>
2024-07-21 13:09:54 +02:00
Agent00Ming
8e15f91c24
input: Emulate discrete scrolling from v120 events (#6881)
* seat: avoid sending axis_stop() when source is wheel

 * fix rounding for absolute discrete values greater than 1

Co-authored-by: Agent_00Ming <agent00ming9366@gmail.com>
2024-07-18 21:57:08 +02:00
Mihai Fufezan
da956c8a97
config: use hyprutils helper (#6891)
* flake.lock: update

nix/overlays: remove xwayland overlay (merged upstream)

* config: use hyprutils helper

* flake.lock: update

* CMake & Meson: update required versions
2024-07-16 21:23:37 +02:00
Khiet Tam Nguyen
bd526822de
config: add option to exit window while retaining fullscreen (#516) (#6880)
* feat: saving fullscreen mode and state for restoring later

* style: no p-prefix, capitalised constants
2024-07-15 13:48:04 +02:00
MightyPlaza
a443902abc
core: Improve handling of window properties (#6776)
* add mWindowProperties

modified:   src/debug/HyprCtl.cpp
modified:   src/desktop/Window.cpp
modified:   src/desktop/Window.hpp
modified:   src/events/Windows.cpp

* support int values
modified:   src/debug/HyprCtl.cpp
modified:   src/desktop/Window.cpp
modified:   src/desktop/Window.hpp

* create m_sWindowData

modified:   src/Compositor.cpp
modified:   src/debug/HyprCtl.cpp
modified:   src/desktop/Window.cpp
modified:   src/desktop/Window.hpp
modified:   src/events/Windows.cpp
modified:   src/layout/DwindleLayout.cpp
modified:   src/layout/IHyprLayout.cpp
modified:   src/layout/MasterLayout.cpp
modified:   src/managers/AnimationManager.cpp
modified:   src/managers/KeybindManager.cpp
modified:   src/managers/XWaylandManager.cpp
modified:   src/render/OpenGL.cpp
modified:   src/render/Renderer.cpp
modified:   src/render/decorations/CHyprBorderDecoration.cpp
modified:   src/render/decorations/CHyprDropShadowDecoration.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp

* simplify some properties
modified:   src/Compositor.cpp
modified:   src/debug/HyprCtl.cpp
modified:   src/desktop/Window.cpp
modified:   src/desktop/Window.hpp
modified:   src/managers/KeybindManager.cpp

* store multiple values in CWindowOverridableVar
modified:   src/Compositor.cpp
modified:   src/debug/HyprCtl.cpp
modified:   src/desktop/Window.cpp
modified:   src/desktop/Window.hpp
modified:   src/events/Windows.cpp
modified:   src/layout/IHyprLayout.cpp
modified:   src/managers/AnimationManager.cpp
modified:   src/managers/KeybindManager.cpp
modified:   src/managers/XWaylandManager.cpp
modified:   src/render/OpenGL.cpp
modified:   src/render/Renderer.cpp
modified:   src/render/decorations/CHyprBorderDecoration.cpp
modified:   src/render/decorations/CHyprDropShadowDecoration.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp

* clean up
modified:   src/Compositor.cpp
modified:   src/Compositor.hpp
modified:   src/config/ConfigManager.cpp
modified:   src/config/ConfigManager.hpp
modified:   src/debug/HyprCtl.cpp
modified:   src/desktop/Window.cpp
modified:   src/desktop/Window.hpp
modified:   src/events/Windows.cpp
modified:   src/layout/DwindleLayout.cpp
modified:   src/layout/IHyprLayout.cpp
modified:   src/layout/IHyprLayout.hpp
modified:   src/layout/MasterLayout.cpp
modified:   src/managers/KeybindManager.cpp

* use SET_PROP priority for exec rules
modified:   src/config/ConfigManager.hpp
modified:   src/desktop/Window.cpp

* add default value
modified:   src/Compositor.cpp
modified:   src/debug/HyprCtl.cpp
modified:   src/desktop/Window.cpp
modified:   src/desktop/Window.hpp
modified:   src/events/Windows.cpp
modified:   src/layout/IHyprLayout.cpp
modified:   src/managers/KeybindManager.cpp
modified:   src/managers/XWaylandManager.cpp
modified:   src/render/OpenGL.cpp
modified:   src/render/Renderer.cpp
modified:   src/render/decorations/CHyprBorderDecoration.cpp
modified:   src/render/decorations/CHyprDropShadowDecoration.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp

* add setprop toggle
modified:   src/config/ConfigManager.hpp
modified:   src/debug/HyprCtl.cpp
modified:   src/desktop/Window.cpp

* add setprop toggle
modified:   src/debug/HyprCtl.cpp

* make window rules functional
modified:   src/config/ConfigManager.cpp
modified:   src/desktop/Window.cpp

* minor fixes
modified:   src/Compositor.cpp
modified:   src/debug/HyprCtl.cpp
modified:   src/desktop/Window.hpp

* properly clean layout data
modified:   src/desktop/Window.cpp
modified:   src/desktop/Window.hpp
modified:   src/events/Windows.cpp
modified:   src/layout/DwindleLayout.cpp
modified:   src/layout/IHyprLayout.cpp
modified:   src/layout/IHyprLayout.hpp
modified:   src/layout/MasterLayout.cpp

* remove newline
modified:   src/events/Windows.cpp

* fixes
modified:   src/config/ConfigManager.hpp
modified:   src/debug/HyprCtl.cpp
modified:   src/desktop/Window.cpp
modified:   src/desktop/Window.hpp

* use CamelCase
modified:   src/Compositor.cpp
modified:   src/debug/HyprCtl.cpp
modified:   src/desktop/Window.cpp
modified:   src/desktop/Window.hpp
modified:   src/events/Windows.cpp
modified:   src/layout/IHyprLayout.cpp
modified:   src/managers/AnimationManager.cpp
modified:   src/managers/KeybindManager.cpp
modified:   src/managers/XWaylandManager.cpp
modified:   src/render/OpenGL.cpp
modified:   src/render/Renderer.cpp
modified:   src/render/decorations/CHyprBorderDecoration.cpp
modified:   src/render/decorations/CHyprDropShadowDecoration.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp
2024-07-11 16:10:42 +02:00
Maximilian Seidler
ede1e63f69 config: don't crash when getenv HOME returns null 2024-07-07 16:59:03 +03:00
drendog
2fa57f2dc4
pointer: change min cursor padding to 0 (#6027)
* 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
2024-07-02 12:17:48 +02:00
John Titor
315f16d501 dbus: import PATH XDG_DATA_DIRS variables into systemd and dbus session 2024-06-23 16:11:50 +03:00