From 1b56cc4e99c391a94fc05a24e1f71c8e425168f1 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Sun, 19 Feb 2023 20:54:53 +0000 Subject: Added an Event Hook System (#1578) * added an eventHookSystem * Add all socket2 events to hooks --- src/helpers/Monitor.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/helpers/Monitor.cpp') diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index bf97a80c..3d00408d 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -132,6 +132,7 @@ void CMonitor::onConnect(bool noRule) { // g_pEventManager->postEvent(SHyprIPCEvent{"monitoradded", szName}); + EMIT_HOOK_EVENT("monitorAdded", this); if (!g_pCompositor->m_pLastMonitor) // set the last monitor if it isnt set yet g_pCompositor->setActiveMonitor(this); @@ -203,6 +204,7 @@ void CMonitor::onDisconnect() { Debug::log(LOG, "Removed monitor %s!", szName.c_str()); g_pEventManager->postEvent(SHyprIPCEvent{"monitorremoved", szName}); + EMIT_HOOK_EVENT("monitorRemoved", this); if (!BACKUPMON) { Debug::log(WARN, "Unplugged last monitor, entering an unsafe state. Good luck my friend."); -- cgit v1.2.3