From 9b03307653c179a86a8dfdb4e5d16446d0cf6e23 Mon Sep 17 00:00:00 2001 From: Alessio Molinari Date: Sun, 17 Nov 2024 20:34:03 +0100 Subject: [PATCH] hooks: add pre connected/disconnected monitor events (#8503) --- src/helpers/Monitor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index bfab2fd3..9ac48220 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -39,6 +39,7 @@ CMonitor::~CMonitor() { } void CMonitor::onConnect(bool noRule) { + EMIT_HOOK_EVENT("preMonitorAdded", self.lock()); CScopeGuard x = {[]() { g_pCompositor->arrangeMonitors(); }}; if (output->supportsExplicit) { @@ -238,6 +239,7 @@ void CMonitor::onConnect(bool noRule) { } void CMonitor::onDisconnect(bool destroy) { + EMIT_HOOK_EVENT("preMonitorRemoved", self.lock()); CScopeGuard x = {[this]() { if (g_pCompositor->m_bIsShuttingDown) return;