Commit graph

156 commits

Author SHA1 Message Date
1d70962892 core: move to steady_clock where applicable
avoid issues when system clock gets desynchronized or changed
2024-06-25 16:05:47 +02:00
Tom Englund
e6d10539af
core: fix a few small memory leaks on exit (#6470)
* renderer: add destructor and destroy event source

add destructor and destroy the event source.
one less leak on exit of compositor reported by asan.

* compositor: cleanup eventloop on exit

destruct hyprctl to release the event sources, and properly cleanup the
event loop on exit of compositor. less leaks on exit reported by asan

* threadmgr: destroy event source on destruction

destroy the event source on destruction.

* eventloopmgr: reset eventloopmgr on exit aswell

reset the eventloopmanager on exit of compositor and free the leaking
last idle frame on monitor destroy.
2024-06-13 12:08:02 +02:00
b0861b6709 config: move various cursor-related vars to cursor: 2024-05-09 22:25:20 +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
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
8a2269272b output-management: move to new impl 2024-05-03 18:08:04 +01:00
Ikalco
387127b12a
config: added option to choose the default monitor for the cursor (#5847)
* added option to choose the default monitor that the cursor will appear in upon startup

* fix: don't set cursor to default monitor after startup

* refactor to checkDefaultCursorWarp also fix focus
2024-05-03 02:39:19 +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
dmayle
6b28bf563e
keybinds: Fix exit trigger by moving it to monitor.frame (#5240) 2024-03-25 01:46:59 +00:00
063708df26 config: improve config value infrastructure 2024-03-03 18:41:38 +00:00
Vaxry
13f6f0b923
Migrate the config to hyprlang (#4656)
* Migrate to hyprlang

* pop up errors

* fix swapped args

* Meson & Nix: build with hyprlang

* CI: add hyprlang to setup action

* add infra for plugin stuff

* fix hyprctl getoption

* fix hyprctl getoption with json

* format

* fix post parse logic

* fix autogen config

* oops missed exec-once

* fmt

* fix ws rules

* require 0.3.0 for hyprlang

* nix: flaek

* minor type fixes

* fix cfg usages in swipe

* use cvarlist for ws rules

* fix throw in addPluginConfigVar

* Nix: update hyprlang

* minor fixes

* fix disableLogs

* mention hyprlang docs

* bump hyprlang dep in cmake

* Meson: bump min hyprlang version

Nix: update hyprlang

* minor fix

* Nix: update meson patch

---------

Co-authored-by: Mihai Fufezan <fufexan@protonmail.com>
2024-02-18 15:00:34 +00:00
305b1419c8 renderer: accept custom state requests for fake outputs 2024-02-14 22:05:41 +00:00
bfcc2adbda monitor: wrap usage of wlr_output_state
for better control and convenience in usage.

fixes #4546
2024-01-28 01:57:13 +00:00
71166ef40b subsurfaceTree: update surface tree protocol feedback on map 2024-01-09 18:14:08 +01:00
Alessio Molinari
1bfd4a2bff
output-layout: fix wlroots display handling (#3718) 2023-11-12 13:14:05 +00:00
Vaxry
55b4f84fea
Internal: Hyprland box implementation (#3755)
* box impl

* remove unused operators

* missed applyfromwlr
2023-11-04 17:03:05 +00:00
Vaxry
21e9313c10
Core: various unsafe state improvements (#3713)
Fixes #3637
2023-11-01 18:53:36 +00:00
df00727310 deps: update wlroots 2023-10-25 00:27:16 +01:00
vaxerski
230356012b renderer: extract solitary check into frame handler 2023-10-04 13:48:44 +01:00
vaxerski
4531717f3e renderer: considerable fixes to repaint logic 2023-10-04 13:39:40 +01:00
vaxerski
a2a29a60e5 tearing: cleanup vars and avoid rendering before drm is ready 2023-09-30 17:07:50 +01:00
vaxerski
a44ab7748f renderer: optimize render pipeline when there is a solitary client 2023-09-29 17:51:07 +01:00
Vaxry
88b63a00b6
renderer: Tearing implementation (#3441) 2023-09-28 21:48:33 +01:00
Vaxry
46d66f4bcc
internal: Further unsafe state improvements (#3404)
Instead of allowing Hyprland to sit in a state where there are no monitors, which various parts of the code don't like, we create a fake headless output on all monitor disconnect, and then remove it when a monitor appears
2023-09-24 18:04:38 +01:00
memchr
e96e0dc02d
refactor: utilize 'middle()' method for window/montior center (#3253) 2023-09-11 10:09:34 +01:00
Philip Damianik
6c855dd6e4
internal: Fix wlr output management (#3234) 2023-09-10 13:14:27 +01:00
Philip Damianik
8c83852704
internal: Remove all .c_str() calls when using std::vformat (#3198)
Signed-off-by: pdamianik <39028343+pdamianik@users.noreply.github.com>
2023-09-06 21:45:37 +02:00
Vaxry
61a71c65ac
internal: Formatter rework (#3186) 2023-09-06 12:51:36 +02:00
Vaxry
d9292800a2
internal: Unsafe state reworks (#3114) 2023-09-01 22:03:56 +02:00
vaxerski
b65adf8d4a toplevelexport: support dmabuf + various fixes 2023-07-20 12:42:25 +02:00
Vaxry
8370a7fcc4
internal: Protocol C++ Wraps + XDGOutput impl (#2733)
move to our own xdgoutput impl instead of wlr's
2023-07-18 15:30:28 +02:00
vaxerski
7a7e3ee6d9 screencopy: don't send frames on commits w/o a buffer 2023-07-12 00:30:42 +02:00
Tuur Vanhoutte
b99ac063ea
Reuse same ID when reconnecting monitor, otherwise use minimum available ID (#2666)
Fixes #2601
2023-07-09 23:08:40 +02:00
01f85a09a9 xwayland: send zero scaling to xwayland if enabled 2023-06-23 21:42:44 +02:00
Shemig
74ca81cc79
Partial revert of Commit 302ec13: (#2539)
Fix crash when screen size is 0x0 (#2523)

Reason: The disable of a monitor with 0x0 size
is causing issuses with some users.

https://github.com/hyprwm/Hyprland/issues/2537

Left the defensive code to resolve the crash.
Will continue to investigate and find a solution for the
dell xps disabled monitor

Co-authored-by: giladsx <gilad@spectalix.com>
2023-06-17 18:49:37 +02:00
Shemig
302ec1372c
Fix crash when screen size is 0x0 (#2523)
(When booting into laptop clam mode in dell XPS)
and also ignore any screen with size 0x0 in the first place

Co-authored-by: giladsx <gilad@spectalix.com>
2023-06-15 22:07:58 +02:00
ce0f248d20 events: remove old comment 2023-06-02 19:50:02 +02:00
vaxerski
a22e1174ee screencopy: implement dmabuf 2023-04-12 21:40:51 +01:00
vaxerski
985764c8db listeners: more safety around change 2023-04-12 20:18:55 +01:00
vaxerski
41d1fdedf2 output: handle needs_frame 2023-04-07 17:25:56 +01:00
vaxerski
cd1b982b2a internal: listen to output.damage events 2023-04-07 16:31:55 +01:00
Alexander Seiler
60527ab180
Fix some typos (#1907)
Signed-off-by: Alexander Seiler <seileralex@gmail.com>
2023-03-29 23:44:25 +01:00
vaxerski
41f7736c85 config: default manual animations to false 2023-03-24 22:24:12 +00:00
Vaxry
a80f8f257f
Feat: Introduce render_ahead_of_time (#1863) 2023-03-24 19:23:16 +00:00
staz
5ce91bb0fd
Added overflow check for blur radius (#1847)
* internal: added overflow check for blur radius

---------

Co-authored-by: vaxerski <43317083+vaxerski@users.noreply.github.com>
2023-03-21 19:01:24 +00:00
vaxerski
adf5d8a114 monitors: update surface outputs on recover from unsafe 2023-03-21 17:46:26 +00:00
vaxerski
d9d57ce39a monitors: fix segfault on non-unsafe remove 2023-03-16 01:04:54 +00:00
vaxerski
f5669a7d6b events: guard output in change 2023-03-15 17:01:20 +00:00
vaxerski
25d3d73dbf monitors: fixes to unsafe mode 2023-03-15 15:11:41 +00:00
vaxerski
34685a836a Move AnimationManager::tick() to an event loop 2023-03-02 17:30:50 +00:00