mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-05 14:42:01 -07:00
@@ -10,10 +10,14 @@
|
||||
|
||||
class CEventLoopManager {
|
||||
public:
|
||||
CEventLoopManager();
|
||||
|
||||
void enterLoop(wl_display* display, wl_event_loop* wlEventLoop);
|
||||
void addTimer(std::shared_ptr<CEventLoopTimer> timer);
|
||||
void removeTimer(std::shared_ptr<CEventLoopTimer> timer);
|
||||
|
||||
void onTimerFire();
|
||||
|
||||
// recalculates timers
|
||||
void nudgeTimers();
|
||||
|
||||
@@ -21,26 +25,12 @@ class CEventLoopManager {
|
||||
struct {
|
||||
wl_event_loop* loop = nullptr;
|
||||
wl_display* display = nullptr;
|
||||
std::thread pollThread;
|
||||
} m_sWayland;
|
||||
|
||||
struct {
|
||||
std::mutex timersMutex;
|
||||
std::mutex timersRqMutex;
|
||||
std::vector<std::shared_ptr<CEventLoopTimer>> timers;
|
||||
std::thread timerThread;
|
||||
bool event = false;
|
||||
std::condition_variable cv;
|
||||
int timerfd = -1;
|
||||
} m_sTimers;
|
||||
|
||||
struct {
|
||||
std::mutex loopMutex;
|
||||
std::mutex eventRequestMutex;
|
||||
bool event = false;
|
||||
std::condition_variable cv;
|
||||
} m_sLoopState;
|
||||
|
||||
bool m_bTerminate = false;
|
||||
};
|
||||
|
||||
inline std::unique_ptr<CEventLoopManager> g_pEventLoopManager;
|
Reference in New Issue
Block a user