Hyprland/src/managers/eventLoop
Tom Englund 21325f9385
eventLoop: various eventloopmgr fixes (#13091)
* 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()
2026-01-27 12:11:54 +00:00
..
EventLoopManager.cpp eventLoop: various eventloopmgr fixes (#13091) 2026-01-27 12:11:54 +00:00
EventLoopManager.hpp eventLoop: remove failed readable waiters 2026-01-05 18:53:29 +01:00
EventLoopTimer.cpp eventloop: improve timer handling to avoid crashes 2025-07-19 16:47:14 +02:00
EventLoopTimer.hpp time: move to stl's clocks and move timer 2025-04-16 01:37:48 +01:00