242 Commits

Author SHA1 Message Date
davc0n
d9cad5e1b6
protocols: refactor class member vars (core) (#10259) 2025-05-03 16:02:49 +02:00
davc0n
50e1bec85f
helpers: refactor class member vars (#10218) 2025-04-30 23:45:20 +02:00
Ikalco
2ee5118d7a
render: properly release rendered buffers (#9807)
* cleanup eglSync

* properly release buffers in renderer

* add renderingDoneCallback and use it in screencopy

* use static constructor for CEGLSync
2025-04-30 18:35:25 +02:00
davc0n
2118440488
windows: refactor class member vars (#10168) 2025-04-28 22:25:22 +02:00
davc0n
02d7badd15
workspaces: refactor class member vars (#10167) 2025-04-25 02:37:12 +02:00
davc0n
0e80ecc534
layers: refactor class member vars (#10149)
* layers: refactor class member vars

* popups: rename m_WLSurface to m_wlSurface
2025-04-24 20:49:49 +02:00
davc0n
241a4935a2
compositor: refactor class member vars (#10141) 2025-04-22 15:23:29 +02:00
davc0n
400dd16072
debug: refactor class member vars (#10130) 2025-04-21 20:42:02 +02:00
davc0n
4d14bcb02f
config: Refactor class member vars (#10124)
* Refactor config classes vars

* Fix clang format errors
2025-04-20 20:39:33 +02:00
Lee Bousfield
7631d4c73f
render, helpers: Call OpenGL destroyMonitorResources on disconnect (#10111)
* render, helpers: Call OpenGL destroyMonitorResources on disconnect

* helpers: Add opengl null check
2025-04-18 17:37:51 +02:00
Vaxry
877fb5b93a time: move to stl's clocks and move timer 2025-04-16 01:37:48 +01:00
Ikalco
0e521788bc
core: wait for dmabuf readiness (#9806)
* add doOnReadable to event loop manager

* move syncTimeline addWaiter to doOnReadable

* wait on dmabuf buffers to be readable

* don't over synchronize in scanout, also give present feedback on same buffer commit
2025-04-16 01:02:31 +02:00
MightyPlaza
ffd6cf65e4
windowrules: allow incrementing window props (#9566) 2025-04-16 01:00:40 +02:00
Nathan Ollerenshaw
533bc5115e
monitors: fix disconnected monitors are reconnected to an empty workspace (#9874)
---------

Co-authored-by: nyx <nnyyxxxx@protonmail.com>
2025-04-14 11:07:53 +02:00
Ikalco
da86db43d4
core: refactor and improve surface commit (#9805)
* make CHLBufferReference not a SP anymore

* copy over release and acquire points in CHLBufferReference

* use CHLBufferReference in screencopy and toplevel export

TODO: use CHLBufferReference in direct scanout properly
      the only problem is the scanout buffer release timing,
      specifically the onBackendRelease mechanism

* cleanup SSurfaceState and surface pending commit tracking

* move surface code from DRMSyncobj, and move acquire to SSurfaceState

* use queue for comitted pending surface states like proto says

"The content update is placed in a queue until it becomes active." - wl_surface::commit

* drop, not release, prev buffer if 2nd buffer wl_surface.attach is sent

"A wl_buffer that has been attached and then replaced by another attach instead of committed will not receive a release event, and is not used by the compositor." - wl_surface::attach
2025-04-07 21:03:27 +02:00
Emad Elsaid
da2d7c3971
config: Fix matching monitor by description to allow space prefix (#9788) 2025-03-30 03:12:15 +02:00
Lee Bousfield
6384f4acf4
core/compositor: Correctly track SHM buffer damage (#9678) 2025-03-22 17:13:44 +01:00
Lee Bousfield
279b06044c
screencopy, render: Use explicit sync for screencopy (#9697)
* screencopy, render: Use explicit sync for screencopy

* screencopy: Check if explicit sync is enabled

* screencopy: Don't require explicit KMS enabled
2025-03-22 17:01:14 +01:00
Lee Bousfield
7ea4fbf0ba
types: Upgrade buffer ref from WP to SP (#9677) 2025-03-20 11:08:47 +00:00
Ikalco
5f60fc7d00
renderer: only commit hw cursor stuff if needed (#9654) 2025-03-17 22:06:41 +01:00
Lee Bousfield
c4f46473df
monitor: Optimize direct scanout damage (#9653) 2025-03-17 22:05:44 +01:00
Lee Bousfield
011d7ccb91
internal: Fix compiler warnings (#9646) 2025-03-17 15:52:40 +01:00
Ikalco
5cef2f44fe
renderer: allow commits when buffer is unchanged but cursor changed (#9648) 2025-03-17 13:06:58 +01:00
Tom Englund
6ffde36466
syncobj: use eventfd instead of stalling fd checks (#9437)
* syncobj: cleanup and use uniqueptrs

cleanup a bit missing removals if resource not good, erasing from
containers etc. make use of unique ptrs instead. and add default
destructors.

* syncobj: rework syncobj entirerly

remove early buffer release that was breaking explicit sync, the buffer
needs to exist until the surface commit event has been emitted and draw
calls added egl sync points, move to eventfd signaling instead of
stalling sync point checks, and recommit pending commits if waiting on a
signal. add a CDRMSyncPointState helper class. move a few weak pointers
to shared pointers so they dont destruct before we need to use them.

* syncobj: queue pending states for eventfd

eventfd requires us to queue pending stats until ready and then apply to
current, and also when no ready state exist commit the client commit on
the current existing buffer, if there is one.

* syncobj: clear current buffer damage

clear current buffer damage on current buffer commits.

* syncobj: cleanup code and fix hyprlock

remove unused code, and ensure we dont commit a empty texture causing
locksession protocol and gtk4-layer-shell misbehaving.

* syncobj: ensure buffers are cleaned up

ensure the containers having the various buffers actually gets cleaned
up from their containers, incase the CSignal isnt signaled because of
expired smart pointers or just wrong order destruction because mishaps.
also move the acquire/point setting to buffer attaching. instead of on
precommit.

* syncobj: remove unused code, optimize

remove unused code and merge sync fds if fence is valid, remove manual
directscanout buffer dropping that signals release point on pageflip, it
can cause us to signal the release point while still keeping the current
buffer and rendering it yet again causing wrong things.

* syncobj: delay buffer release on non syncobj

delay buffer releases on non syncobj surfaces until next commit, and
check on async buffers if syncobj and drop and signal the release point
on backend buffer release.

* syncobj: ensure we follow protocol

ensure we follow protocol by replacing acquire/release points if they
arrive late and replace already existing ones. also remove unneded
brackets, and dont try to manual lock/release buffers when it comes to
explicit protocol. it doesnt care about buffer releases only about
acquire and release points and signaling them.

* syncobj: lets not complicate things

set points in precommit, before checking protocol errors and we catch
any pending acquire/release points arriving late.

* syncobj: move SSurfaceState to types

remove destructor resource destroying, let resources destroys them on
their events, and move SSurfaceStates to types/SurfaceState.hpp

* syncobj: actually store the merged fd

have to actually store the mergedfd to use it.

* syncobj: cleanup a bit around fences

ensure the current asynchronous buffer is actually released on pageflip
not the previous. cleanup a bit FD handling in
commitPendingAndDoExplicitSync, and reuse the in fence when syncing
surfaces.

* syncobjs: ensure fence FD doesnt leak

calling resetexplicitfence without properly ensuring the FD is closed
before will leak it, store it per monitor and let it close itself with
the CFileDescriptor class.

* syncobj: ensure buffers are actually released

buffers were never being sent released properly.

* types: Defer buffer sync releaser until unlock

* syncobj: store directscanout fence in monitor

ensure the infence fd survives the scope of attemptdirectscanout so it
doesnt close before it should have.

* syncobj: check if if acquire is expired

we might hit a race to finish on exit where the timeline just has
destructed but the buffer waiter is still pending. and such we
removeAllWaiters null dereferences.

* syncobj: code style changes

remove quack comment, change to m_foo and use a std::vector and
weakpointer in the waiter for removal instead of a std::list.

* syncobj: remove unused async buffer drop

remove unused async buffer drop, only related to directscanout and is
handled elsewhere.

---------

Co-authored-by: Lee Bousfield <ljbousfield@gmail.com>
2025-03-14 15:08:20 +01:00
UjinT34
8c97cb7858
renderer: add simple color management (#9506)
Adds proper color management and transformations for CM surfaces.
2025-03-14 00:15:18 +01:00
Ikalco
d30cc19d25
renderer: skip ds commits if buffer didn't change (#9556)
this fixes direct scanout glitches by ensuring that attemptDirectScanout doesn't try to recommit the same buffer to AQ
which would cause a pageflip event and the backendRelease to release the same buffer too early
2025-03-08 20:24:22 +01:00
Matt White
b51ab182ae
socket2: add activespecialv2 (#9530) 2025-03-05 20:33:33 +01:00
Vaxry
11943f761e monitor: avoid crash on expired special workspace monitor owner
fixes #9477
2025-03-01 15:56:44 +00:00
Vaxry
1309b59f2c monitor: report a scheduled frame when tearing on cursor move 2025-02-15 00:18:43 +00:00
Anthony Ruhier
5d2b008294
renderer: disable explicit if aquamarine output doesn't support it (#9396) (#9398)
The explicit settings ignore the aquamarine output.supportsExplicit
attribute, which creates glitches on drivers not supporting explicit
sync (example: freedreno).

If the output has been set as not supporting explicit, disable the
explicit settings.
2025-02-13 11:09:25 +00:00
Vaxry
70cfc7cc9c cmonitor: guard old workspace 2025-02-03 19:53:14 +00:00
UjinT34
31431a9271
protocols: Support content-type-v1 proto (#9226) 2025-02-02 20:25:29 +01:00
Ikalco
e6a9cfab91
monitor: preferred mode now tries first 3 modes if preferred fails before erroring (#9246) 2025-01-31 13:23:32 +01:00
Tom Englund
32c0fa2f2f
core: begin using CFileDescriptor from hyprutils (#9122)
* config: make fd use CFileDescriptor

make use of the new hyprutils CFileDescriptor instead of manual FD
handling.

* hyprctl: make fd use CFileDescriptor

make use of the new hyprutils CFileDescriptor instead of manual FD
handling.

* ikeyboard: make fd use CFileDescriptor

make use of the new CFileDescriptor instead of manual FD handling, also
in sendKeymap remove dead code, it already early returns if keyboard
isnt valid, and dont try to close the FD that ikeyboard owns.

* core: make SHMFile functions use CFileDescriptor

make SHMFile misc functions use CFileDescriptor and its associated usage
in dmabuf and keyboard.

* core: make explicit sync use CFileDescriptor

begin using CFileDescriptor in explicit sync and its timelines and
eglsync usage in opengl, there is still a bit left with manual handling
that requires future aquamarine change aswell.

* eventmgr: make fd and sockets use CFileDescriptor

make use of the hyprutils CFileDescriptor instead of manual FD and
socket handling and closing.

* eventloopmgr: make timerfd use CFileDescriptor

make the timerfd use CFileDescriptor instead of manual fd handling

* opengl: make gbm fd use CFileDescriptor

make the gbm rendernode fd use CFileDescriptor instead of manual fd
handling

* core: make selection source/offer use CFileDescriptor

make data selection source and offers use CFileDescriptor and its
associated use in xwm and protocols

* protocols: convert protocols fd to CFileDescriptor

make most fd handling use CFileDescriptor in protocols

* shm: make SHMPool use CfileDescriptor

make SHMPool use CFileDescriptor instead of manual fd handling.

* opengl: duplicate fd with CFileDescriptor

duplicate fenceFD with CFileDescriptor duplicate instead.

* xwayland: make sockets and fds use CFileDescriptor

instead of manual opening/closing make sockets and fds use
CFileDescriptor

* keybindmgr: make sockets and fds use CFileDescriptor

make sockets and fds use CFileDescriptor instead of manual handling.
2025-01-30 11:30:12 +00:00
Honkazel
7d1c78f4a3
core,hyprctl: clang, clang-tidy, typo fixes and dtors changes (#9233)
* declare dtor once + DMABBUF typo fix

* dup include + clang moment

* linux-dmabuf: last minute nit change
2025-01-30 11:07:06 +00:00
Vaxry
6131919715 monitor: round refresh rates in sorting modes
fixes #9209
2025-01-29 13:34:11 +00:00
Vaxry
e951011503 renderer/internal: stop using box pointers
in favor of const refs
2025-01-26 15:05:34 +00:00
Vaxry
16aeb24bc1 core: make persistent workspaces always follow the config
instead of just staying after open, they will now be enforced on their respective monitors

fixes #8769
2025-01-26 14:40:42 +00:00
vaxerski
47d645d84a core: fixup includes 2025-01-17 19:14:55 +01:00
user111111111111111111111111111111111
2bad73354a
core: cleanup header includes (#9088)
Cleanup some unneeded includes to speed up compilation
2025-01-17 15:21:35 +00:00
Alexander
15dc024a39
keybinds: fix previous_per_monitor logic (#9010)
Co-authored-by: Крылов Александр <aleksandr.krylov@hyperus.team>
2025-01-11 16:05:53 +00:00
Maximilian Seidler
5642ed331d
core: move parts of the animation system to hyprutils (#8868)
* core: change animation manager to use Hyprutils::Animation

* config: move animation config to hyprutils animation tree

* use g_pAnimationManager->createAnimation and the new PHLANIMVAR template

* core: use CGenericAnimatedVariabled::{enabled,setConfig,getStyle} and adapt callbacks

* core: adapt animated variable usage (dereference the shared pointer)

* misc: bump CMakeLists to hyprutils 0.3.3
2025-01-07 17:55:14 +00:00
vaxerski
aff34089c4 monitor: avoid crashes on no good modes
fixes #8915
2025-01-01 13:47:16 +01:00
Ikalco
af301312d5
core: fix custom resolutions (#8897) 2024-12-30 18:45:42 +00:00
Ikalco
8d4c18d723
core: refactor/improve monitor mode selection (#8804) 2024-12-28 13:32:04 +00:00
vaxerski
2e2e2e2cad monitor: bring back old description behavior
this makes description match the beginning again. Fixes #8756
2024-12-23 21:17:38 +00:00
Ikalco
5b714f05f8
internal: Make static analysis more happy (#8767)
* make functions used in 1 file static

* fix invalid substr param -1

* give default initializer to borderGradier

* move RASSERT from printf to std::print
2024-12-19 02:56:01 +01:00
Vaxry
a5234f26e4 core: drop using deques in favor of vectors
No point in most of these.
2024-12-16 15:58:19 +00:00
Vaxry
8bbeee1173
core: Add clang-tidy (#8664)
This adds a .clang-tidy file for us.

It's not a strict requirement to be compliant, but I tuned it to be alright.
2024-12-07 18:51:18 +01:00
Vaxry
745a82ce8a core: workspace-related function cleanup / refactor
CCompositor is massive, and has a lot of functions that could be better optimized if in CWorkspace
2024-11-22 16:01:02 +00:00