mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-24 00:09:48 +01:00
98a4fa2b0d
* clang-format stuff and format files
35 lines
No EOL
775 B
C++
35 lines
No EOL
775 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();
|
|
|
|
std::mutex eventQueueMutex;
|
|
std::deque<SHyprIPCEvent> m_dQueuedEvents;
|
|
|
|
std::deque<std::pair<int, wl_event_source*>> m_dAcceptedSocketFDs;
|
|
};
|
|
|
|
inline std::unique_ptr<CEventManager> g_pEventManager; |