Commit graph

606 commits

Author SHA1 Message Date
fb15b7aa2a core: Move to hyprutils for Math
Moves CRegion, CBox and Vector2D over to hyprutils.

Requires hyprutils>=0.1.4
2024-06-19 16:20:15 +02:00
Tom Englund
28ce0e0f80
misc: a few compiler level performance optimisations (#6559)
* window: use const references instead of copies

use const references instead of wasteful copies and make the = operator
check for self assignment and return early. also use const in all the
other operators.

* listener: pass std::function as const reference

instead of copies pass the std::functions as const references.

* config: dont unnecessarily convert to c_str

getHyprlangConfigValuePtr wants an std::string and we already have an
std::string, dont convert it to a c_str only for it to be converted back
to an std::string.

* buffer: pass attributes as const reference

pass attributes as const reference instead of copies.
2024-06-17 17:37:36 +02:00
1360677478 subcompositor/renderer: fixup handling of subsurfaces below the main one
some apps (notably vlc 4) place a subsurface below the main surface (which is kinda cursed) but we have to accomodate for that
2024-06-17 12:42:39 +02:00
2f278dc883 egl: fixup format modifier lookups with implicit modifiers
ref #6485
2024-06-14 21:59:21 +02:00
12ce06f39b format: fix flipped r/b channels on legacy_renderer
We don't wanna use an extension, but for gles2 there is no other option.

fixes #6465
2024-06-14 19:10:12 +02:00
UjinT34
a9d53a2252
vrr: add option to fix mouse breaking vrr (#6483)
* option to fix mouse breaking vrr

* skip damage on mouse move

* remove this-> & cleanup

* add cursor:min_refresh_rate to avoid cursor freezing

* run clang-format

---------

Co-authored-by: UjinT34 <ujin@uvpn.ru>
2024-06-14 13:45:32 +02:00
phonetic112
8055b1c00a
misc: Fix build warnings (#6486) 2024-06-13 23:23:23 +02:00
Jan Beich
4842eb83b4
helpers: make shm_open() portable after 8bcccf9f0f (#6471)
https://pubs.opengroup.org/onlinepubs/9699919799/functions/shm_open.html
https://man.freebsd.org/shm_open/2
https://www.man7.org/linux/man-pages/man3/shm_open.3.html
2024-06-13 14:20:14 +02:00
a9d7befc36 formats: fixup for legacy_renderer builds 2024-06-12 23:29:24 +02:00
Vaxry
8c64a4bad7
core: move to hyprutils for utils (#6385)
* core: move to hyprutils for utils

Nix: add hyprutils dep

* Meson: add hyprutils dep

* flake.lock: update

---------

Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
2024-06-11 17:17:45 +02:00
1423707dbe output: remove wl_output globals for mirrored displays
ref #6387
2024-06-10 00:06:42 +02:00
Mykola Perehudov
bf75723f27
helpers: fix misuse of syscalls in sd namespace (#6379) 2024-06-09 09:43:39 +02:00
memchr
7789caad39
build: include missing header: "debug/Log.hpp" in Format.cpp (#6365) 2024-06-08 16:25:01 +02:00
Vaxry
6967a31450
wayland/core: move to new impl (#6268)
* wayland/core/dmabuf: move to new impl

it's the final countdown
2024-06-08 10:07:59 +02:00
giskard
ebf258788e
config: add tag dispacther and window rule (#6211) 2024-05-28 23:37:24 +02:00
Vaxry
addd3e7f1a
xwayland: move to hyprland impl (#6086) 2024-05-25 22:43:51 +02:00
6d67b84469 monitor: avoid UB on undefined auto dir
ref #6217
2024-05-24 20:56:53 +02:00
System64
255272ea18
debug: Add ARM GPU info (#6212)
Added a simple way to get basic info about the GPU on ARM based systems
2024-05-23 18:04:39 +02:00
9eec4cb670 sysd: add missing header
ref #6094
2024-05-15 23:01:50 +01:00
JManch
a8522db683
keybinds: fix empty on monitor for new workspaces (#6089) 2024-05-15 21:03:51 +01:00
7eeee2c94e wl-data-device: move to hyprland impl 2024-05-14 23:13:35 +01:00
121d3a7213 wl_seat: move to hyprland impl 2024-05-14 23:02:24 +01:00
38911d6df4 box: fix noNegativeSize 2024-05-10 12:59:01 +01:00
a7e23d2f1e presentation-time: move to new impl 2024-05-10 02:38:54 +01:00
b0861b6709 config: move various cursor-related vars to cursor: 2024-05-09 22:25:20 +01:00
635a02d83f layer-shell: move to new impl
Also bumps the hw-s dep
2024-05-09 22:02:18 +01:00
84e8d1810d Tablet: move to new impl
Ring and strip are not implemented. Will I implement this? God fucking knows. Nobody seems to have that anyways.
2024-05-09 13:37:39 +01:00
ed411f53bd cursor: move to a hyprland impl
This moves wlr_cursor to a completely new impl mostly under
CPointerManager

Also adds beginSimple to OpenGL for simple render passes (e.g. cursor)
2024-05-09 13:37:39 +01:00
William Gray
36d32973dd
keybinds: add empty on monitor and next empty flags (#5936)
* empty on monitor

* add flag for next empty

* clang-format changes

* next also uses m_pLastMonitor
2024-05-08 13:30:20 +01:00
Username404-59
57a12476de
internal: Add missing errno.h include to SdDaemon.cpp (#5938)
Fixes clang
2024-05-07 23:13:58 +01:00
0c446ec5f4 memory: fix SP/WP hierarchy templates 2024-05-06 21:36:31 +01:00
Vaxry
1ed1ce9506
internal: new shared_ptr and weak_ptr implementation (#5883)
moves std::shared_ptrs to a new implementation

Advantages:
- you can dereference a weak_ptr directly. This will obviously segfault on a nullptr deref if it's expired.
   - this is useful to avoid the .lock() hell where we are 100% sure the pointer _should_ be valid. (and if it isn't, it should throw.)
- weak_ptrs are still valid while the SP is being destroyed.
   - reasoning: while an object (e.g. CWindow) is being destroyed, its `weak_ptr self` should be accessible (the sp is still alive, and so is CWindow), but it's not because by stl it's already expired (to prevent resurrection)
   - this impl solves it differently. w_p is expired, but can still be dereferenced and used. Creating `s_p`s is not possible anymore, though.
   - this is useful in destructors and callbacks.
2024-05-05 17:16:00 +01:00
1237732b97 input: Introduce basic hyprland HID classes
Implements an intermediary HID class for mice, keyboards and touch devices, removing the old structs from WLClasses.hpp

Yes, virtual ones are duplicated a bit, but will likely be de-duped once wlr_input_device is not used anymore.
2024-05-03 22:40:27 +01:00
William Gray
1d2acbe193
config: add absolute monitor workspace selectors (#5848)
* add absolute monitor workspace selectors

* implement absolute for `r`

* format code
2024-05-03 18:38:00 +01:00
8a2269272b output-management: move to new impl 2024-05-03 18:08:04 +01:00
Tom Englund
d5bf15387a
internal: fix a few asan reported leaks on exit of hyprland (#5852)
* notifications: free cairo images on destruction

asan reports a leak on exit if we dont free the image we created in the
draw function. add a destructor and free images on exit.

* compositor: destroy wlroots types on exit

there are a few types not being destroyed on exit and causing a leak on
exit in wlroots reported by asan, add those.

* cursormgr: ensure we destroy cursor mgr on exit

add a destructor and call wlr_xcursor_manager_destroy on the manager on
destruction, leak reported by asan.

* keybindmgr: free state and keymap

add missing keymap_unref on creation, and add a destructor and free the
state on exit. leak reported by asan.

* skeyboard: add destructor and free state

free the state on destruction of keyboard, reported as leak by asan
2024-05-03 14:42:08 +01:00
2755297670 virtual-pointer: move to new impl 2024-05-03 01:52:05 +01:00
7d49819b5e virtual-keyboard: destroy on vdestroy event 2024-05-03 00:54:32 +01:00
6aa2d123ae virtual-keyboard: move to new impl 2024-05-03 00:31:48 +01:00
8bcccf9f0f ime-v2: move to new impl 2024-05-01 16:41:17 +01:00
5edc32930d layerSurface: refactor/move to a memory-safe impl
Makes all the pointers smart to avoid memory issues
Refactors layerSurface code to live inside desktop/layersurface
2024-04-30 02:41:27 +01:00
33e0bb1478 wlr-output-power: move to new impl 2024-04-29 01:38:24 +01:00
Vaxry
bca7804bb6
internal: Window storage rework - part 1 (#5762)
* Window storage rework - part 1

* format

* remove useless include

* fix pch

* format

* fix crash in dwindle

* fix vram leak

* prefer .expired() for bool checks
2024-04-27 12:43:12 +01:00
25aec3ac8c pointer-constraints: move to new impl 2024-04-27 03:17:04 +01:00
01df3b73d8 shortcuts-inhibitor: move to new impl 2024-04-25 14:32:35 +01:00
Agent00Ming
81bb4eb2f6
workspace: Fix duplication of "special:" in special workspace name (#5729)
* Fix duplication of "special:" in special workspace name
	modified:   src/desktop/Workspace.cpp

* Track default special workspace name as special:special
This is to fix the edge cases with the previous commit without breaking
user configs.

	modified:   src/helpers/MiscFunctions.cpp

---------

Co-authored-by: Agent_00Ming <agent00ming9366@gmail.com>
2024-04-24 16:07:22 +01:00
Gabriel Ford
c3ec16f494 config: Add More Monitor 'Auto' Positions. (#5670)
* Reverse Window Positioning.

* Cleanup old comments and logs.

* Finish Splitting Left and Right offset.

* Forgot to add Auto Left to ConfigManager

* Fix problems with auto_left.

* Nearly finish up and down.

* Finish draft of all four dirs. Testing now.

* Change Y value in moveTo for up and down.

* Format, comment, and cleanup.

* Address Vaxry's feedback.

* Add check to see if auto position is first rule.

* Run clang-format.
2024-04-23 01:49:25 +01:00
741c75d907 gamma-control: move to new impl 2024-04-22 18:21:03 +01:00
d9fe1d0f58 idle-inhibit: move to new impl 2024-04-21 16:54:52 +01:00
e823b5d693 Window: add destroy signal 2024-04-21 16:54:50 +01:00