3
0
mirror of https://github.com/hyprwm/Hyprland.git synced 2026-03-05 14:54:45 +00:00
Files
Hyprland/src/managers/EventManager.hpp
2022-10-03 20:47:15 +01:00

37 lines
656 B
C++

#pragma once
#include <deque>
#include <fstream>
#include <mutex>
#include "../defines.hpp"
#include "../helpers/MiscFunctions.hpp"
struct SHyprIPCEvent {
std::string event;
std::string data;
};
class CEventManager {
public:
CEventManager();
void postEvent(const SHyprIPCEvent event, bool force = false);
void startThread();
bool m_bIgnoreEvents = false;
std::thread m_tThread;
private:
void flushEvents();
void ensureFDsValid();
std::mutex eventQueueMutex;
std::deque<SHyprIPCEvent> m_dQueuedEvents;
std::deque<int> m_dAcceptedSocketFDs;
};
inline std::unique_ptr<CEventManager> g_pEventManager;