core: Event loop rework (#5466)

* Event loop rework

* revert missed
This commit is contained in:
Vaxry
2024-04-07 03:31:51 +01:00
committed by GitHub
parent 9f1604e4b0
commit f2a848cbcc
7 changed files with 281 additions and 7 deletions

View File

@@ -2,6 +2,7 @@
#include "helpers/Splashes.hpp"
#include "config/ConfigValue.hpp"
#include "managers/CursorManager.hpp"
#include "managers/eventLoop/EventLoopManager.hpp"
#include <random>
#include <unordered_set>
#include "debug/HyprCtl.hpp"
@@ -453,6 +454,9 @@ void CCompositor::cleanup() {
void CCompositor::initManagers(eManagersInitStage stage) {
switch (stage) {
case STAGE_PRIORITY: {
Debug::log(LOG, "Creating the EventLoopManager!");
g_pEventLoopManager = std::make_unique<CEventLoopManager>();
Debug::log(LOG, "Creating the HookSystem!");
g_pHookSystem = std::make_unique<CHookSystemManager>();
@@ -628,7 +632,7 @@ void CCompositor::startCompositor() {
// This blocks until we are done.
Debug::log(LOG, "Hyprland is ready, running the event loop!");
wl_display_run(m_sWLDisplay);
g_pEventLoopManager->enterLoop(m_sWLDisplay, m_sWLEventLoop);
}
CMonitor* CCompositor::getMonitorFromID(const int& id) {