mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-03 13:41:59 -07:00
Added an Event Hook System (#1578)
* added an eventHookSystem * Add all socket2 events to hooks
This commit is contained in:
@@ -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.");
|
||||
|
Reference in New Issue
Block a user