summaryrefslogtreecommitdiff
path: root/src/managers/eventLoop
Commit message (Collapse)AuthorAgeFilesLines
* xdg-shell: queue state updates for toplevel (#14227)Vaxry2026-04-302-9/+48
| | | ref https://github.com/hyprwm/Hyprland/discussions/14224
* internal: silence compiler warnings about unused return values (#13997)Tom Englund2026-04-051-1/+3
| | | | | | | | | | | | | | | | * misc: silence warnings about ignoring return value on reads silence warnings on ignored return values on read() and print an error if it occurs. * misc: silence warnings about ignoring return value on writes silence warnings on ignored return values on write() and print an error where we can, or pass them the maybe_unused attribute. * misc: silence warnings about ignoring return value on pipe silence warnings on ignored return value on pipe(), print an error and exit on failure.
* config: cleanup the entire config infrastructure (#13785)Vaxry2026-03-201-3/+3
| | | | Massively refactors the config infrastructure, sorely needed and will be req'd for the lua stuff
* eventLoop: various eventloopmgr fixes (#13091)Tom Englund2026-01-271-12/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * eventloopmgr: use unordered_map for readableWaiters use an unordered_map with the raw ptr as key, avoids any risk of dangling ptrs. * eventloopmgr: read the timerfd fd the manpage for timerfd_create and read states this. timefd_create creates a new timer object, and returns a file descriptor that can be used to read the number of expirations that have occurred. The FD becomes readable when the timer expires. read removes the “readable” state from the FD. so most likely it has somewhat worked because of the scheduleRecalc() function. * eventloopmgr: avoid unneeded std::function copy move the idle functions instead of copying. * eventloopmgr: remove event source before calling fn if fn causes a dispatch/reentry its gonna cause UB inside libwayland itself, remove the event source before calling the fn() avoids that entirerly. even if a new dispatch occurs. * eventloopmgr: check if timer fd is readable check if timerfd is readable before calling read on it, so we dont end up blocking on an accident, log an error if its not readable. * eventloopmgr: revert unordered_map change my mistake, the address wasnt changing on reallocations of the heap object. the only issue i was triggering was the reentry path in fn()
* eventLoop: remove failed readable waitersVaxry2026-01-052-0/+12
|
* debug: move to hyprutils' logger (#12673)Vaxry2025-12-181-3/+3
|
* renderer: asynchronously load background tex (#11749)Vaxry2025-09-181-0/+1
| | | | | | | Bumps required hyprgraphics to 0.1.6 --------- Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
* disable buffer readability checks on intel (#11515)Tom Englund2025-08-242-3/+3
| | | | | | | | | | | | * dmabuf: disable buffer read check on intel readability checks directly on buffer fds on some intel laptops is broken, see https://gitlab.freedesktop.org/drm/intel/-/issues/9415 * sync: use rvalue ref in addwaiter doonreadable use rvalue reference in addwaiter and doonreadable, because we store the function in the SReadableWaiter a lot of the time, move it into place there when that happends or let it go out of scope after function call.
* refactor: Use new hyprutils casts (#11377)Kamikadze2025-08-141-4/+4
|
* eventloop: improve timer handling to avoid crashesVaxry2025-07-193-8/+24
| | | | ref #11062
* eventloop: avoid duplicate timersVaxry2025-07-191-2/+7
|
* core: use new typed signals from hu (#10853)outfoxxed2025-07-081-1/+1
|
* eventloop: RAII the even source on readable fdTom Englund2025-07-072-5/+17
| | | | RAII remove the event source and honor rule by 5
* eventLoop: fixup headersVaxry2025-05-261-1/+1
|
* eventLoop: fixup event source callbacksVaxry2025-05-191-8/+12
|
* inputs: refactor class member vars (#10230)davc0n2025-05-012-39/+39
|
* compositor: refactor class member vars (#10141)davc0n2025-04-221-4/+4
|
* time: move to stl's clocks and move timerVaxry2025-04-162-23/+24
|
* core: wait for dmabuf readiness (#9806)Ikalco2025-04-162-3/+56
| | | | | | | | | * 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
* helpers: Add an async dialog box impl (#9919)Vaxry2025-04-061-0/+1
| | | Adds an async dialog box, way safer than our previous local solution for ANR
* core: begin using CFileDescriptor from hyprutils (#9122)Tom Englund2025-01-302-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* core: move all shared_ptrs from the STL to hyprutils (#9143)Vaxry2025-01-231-1/+1
|
* core/renderer: Add GPU hotplug support (#8980)maround952025-01-232-14/+47
|
* core: move to inotify for monitoring the config filesvaxerski2025-01-192-0/+13
| | | | | | instead of manually polling every second which is not efficient, use inotify. an added bonus is that inotify is much much faster
* core: Add clang-tidy (#8664)Vaxry2024-12-071-2/+2
| | | | | This adds a .clang-tidy file for us. It's not a strict requirement to be compliant, but I tuned it to be alright.
* internal: more profiling less calls and local copies (#8300)Tom Englund2024-10-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * compositor: reduce amount of window box copies mousemoveunified can call this very frequently, the cbox copying actually shows up as an impact in such cases, move it down in the scope and only do it when necessery. * core: constify and reference frequent calls profiling shows these as frequent called functions try to reduce the amount of copies with references and const the variables. * pointermgr: remove not used local copy, const ref remove unneded local copies and const ref cursorsize. * inputmgr: reduce amount of calls to vectortowindow the amount of calls to g_pCompositor->vectorToWindowUnified fast ramps up in cpu usage with enough windows existing and moving the mouse, move the PWINDOWIDEAL up and reuse it if its already the same. * protocol: compositor remove unused local copy remove unused local copy of accumulateCurrentBufferDamage and const previousBuffer. * renderer: reduce scope of variables and refactor move a few variables down in their scopes to reduce the amount of calls and copies when not needed, also add one more for loop in renderWorkspaceWindows and store the windows in a vector with weakpointers that should be rendered, this adds a loop but reduces the amount of repeated calls to shouldRenderWindow and also makes the rest of the loops go over way smaller vector when many windows exist.
* eventloop: dispatch pending in session on startVaxry2024-09-241-0/+4
| | | | fixes #7855 #7391
* config: Add a window rule to render while unfocused (#7582)Vaxry2024-08-302-0/+5
|
* misc: constify the remaining for loops (#7534)Tom Englund2024-08-261-5/+5
| | | now we roll loops at blazing constified speed.
* eventloop: don't dispatch in enterLoopVaxry2024-08-101-1/+0
| | | | ref #6842, BSD blocks in udev on no event apparently
* internal: introduce new types to avoid unsigned int rollover and signed int ↵Tom Englund2024-08-081-2/+2
| | | | | | | | | | | | | | | | | | | | 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
* internal: some minor fd/socket cleanups and make logging thread safe (#7123)Tom Englund2024-07-311-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bezier: dont loop on float values Using a floating-point loop variable with a fixed increment can cause precision errors over time due to the nature of floating-point arithmetic. and cause undesired effects. ex iteration 1 = 0.10000000149011611938 iteration 2 = 0.20000000298023223877 eventually.. iteration 8 = 0.80000001192092895508 iteration 9 = 0.89999997615814208984 * hyprctl: close sockets on destruction store socketpath and close the fd and unlink the socket path on exit. * eventloopmgr: close the timerfd close the timerfd on exit. * debug: make logging thread safe instead of opening and closing the logfile on each write open it on init and close it on compositor exit. also add a mutex so accidently using logging from a thread like the watchdog or similiar doesnt cause issues. * xwl: clean up fd logic check if the fd is actually opened before closing, and close the pipesource FD on exit.
* core: Properly shutdown wl display (#7018)Ikalco2024-07-241-0/+6
| | | | | | | * correctly destroy wayland globals * properly shutdown and cleanup hyprland * appease the nitpick gods and some comments
* Core: Move to aquamarine (#6608)Vaxry2024-07-212-4/+27
| | | | | | | | | | | | | | 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>
* pointer: update geometry after unplug eventsVaxry2024-07-052-11/+41
| | | | | | fixes #6700 fixes #6740
* core: move to steady_clock where applicableVaxry2024-06-252-9/+9
| | | | avoid issues when system clock gets desynchronized or changed
* core: move to hyprutils for utils (#6385)Vaxry2024-06-111-1/+1
| | | | | | | | | | | | | * 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>
* core: fix a few asan reported issues and a coredump on exit (#6285)Tom Englund2024-06-032-3/+10
| | | | | | | | | | | | | | | | | | * xwayland: add destructor to CXWM and free resource the wl_event_resource was running upon destruction of the compositor causing a null pointer segfault in onX11Event so ensure the event is removed upon destruction, also free the memory allocated by xcb_errors_context_new and finally call xcb_disconnect on the connection to free the fd and its memory. * hyprctl: dont leak the fd on destruction add a destructor and properly free the fd on destruction * eventloop: add destructor and free event source properly free the wl_event_source upon destruction.
* eventloop: don't call lost timersVaxry2024-05-072-1/+5
|
* internal: new shared_ptr and weak_ptr implementation (#5883)Vaxry2024-05-054-18/+17
| | | | | | | | | | | 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.
* cmake: Some small cmake cleanups (#5572)Yaroslav2024-04-131-1/+0
| | | | | | | | | | | | | | | | | | | | | | * remove unnecessary include * cmake: use pkg_get_variable We can find wayland-scanner executable and wayland-protocols dir by taking advantage of this function, so no need to use find_program or manually call pkgconf executable. * cmake: remove explicit rdynamic option CMAKE_ENABLE_EXPORTS=ON already implies rdynamic so it's redundant to set the latter explicitly. Also, CMAKE_ENABLE_EXPORTS is superseded by CMAKE_EXECUTABLE_ENABLE_EXPORTS in cmake 3.27. * cmake: make xcb-errors dep optional xcb-errors is being used in wlroots, where it's optional. So make it optional in hyprland as well
* style: run clang-formatVaxry2024-04-081-1/+1
|
* eventloop: move timers to an event loop fdVaxry2024-04-073-129/+62
| | | | fixes #5481
* core: Event loop rework (#5466)Vaxry2024-04-074-0/+268
* Event loop rework * revert missed