summaryrefslogtreecommitdiff
path: root/src/managers/eventLoop/EventLoopManager.hpp
diff options
context:
space:
mode:
authormaround95 <39220886+maround95@users.noreply.github.com>2025-01-23 13:08:19 +0200
committerGitHub <noreply@github.com>2025-01-23 11:08:19 +0000
commitf1bd62806e538fa2bfa7899c2b2ad02d6a5ca2db (patch)
treed5d43d42f7ab977a090db3b626288f0638ece427 /src/managers/eventLoop/EventLoopManager.hpp
parentfda5626594c3f31bbab08e877a797a623c98c450 (diff)
core/renderer: Add GPU hotplug support (#8980)
Diffstat (limited to 'src/managers/eventLoop/EventLoopManager.hpp')
-rw-r--r--src/managers/eventLoop/EventLoopManager.hpp29
1 files changed, 21 insertions, 8 deletions
diff --git a/src/managers/eventLoop/EventLoopManager.hpp b/src/managers/eventLoop/EventLoopManager.hpp
index 90402de2..e1c243d3 100644
--- a/src/managers/eventLoop/EventLoopManager.hpp
+++ b/src/managers/eventLoop/EventLoopManager.hpp
@@ -1,9 +1,11 @@
#pragma once
#include <condition_variable>
+#include <map>
#include <mutex>
#include <thread>
#include <wayland-server.h>
+#include "helpers/signal/Signal.hpp"
#include "EventLoopTimer.hpp"
@@ -36,11 +38,18 @@ class CEventLoopManager {
};
private:
+ // Manages the event sources after AQ pollFDs change.
+ void syncPollFDs();
+
+ struct SEventSourceData {
+ SP<Aquamarine::SPollFD> pollFD;
+ wl_event_source* eventSource = nullptr;
+ };
+
struct {
- wl_event_loop* loop = nullptr;
- wl_display* display = nullptr;
- wl_event_source* eventSource = nullptr;
- std::vector<wl_event_source*> aqEventSources;
+ wl_event_loop* loop = nullptr;
+ wl_display* display = nullptr;
+ wl_event_source* eventSource = nullptr;
} m_sWayland;
struct {
@@ -48,12 +57,16 @@ class CEventLoopManager {
int timerfd = -1;
} m_sTimers;
- SIdleData m_sIdle;
- std::vector<SP<Aquamarine::SPollFD>> aqPollFDs;
+ SIdleData m_sIdle;
+ std::map<int, SEventSourceData> aqEventSources;
+
+ struct {
+ CHyprSignalListener pollFDsChanged;
+ } m_sListeners;
- wl_event_source* m_configWatcherInotifySource = nullptr;
+ wl_event_source* m_configWatcherInotifySource = nullptr;
friend class CSyncTimeline;
};
-inline std::unique_ptr<CEventLoopManager> g_pEventLoopManager; \ No newline at end of file
+inline std::unique_ptr<CEventLoopManager> g_pEventLoopManager;