mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-11 17:05:58 +01:00
34 lines
No EOL
604 B
C++
34 lines
No EOL
604 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:
|
|
|
|
std::mutex eventQueueMutex;
|
|
std::deque<SHyprIPCEvent> m_dQueuedEvents;
|
|
|
|
std::deque<int> m_dAcceptedSocketFDs;
|
|
};
|
|
|
|
inline std::unique_ptr<CEventManager> g_pEventManager; |