Skip to content

Commit

Permalink
hooks: add pre connected/disconnected monitor events (#8503)
Browse files Browse the repository at this point in the history
  • Loading branch information
levnikmyskin authored Nov 17, 2024
1 parent b735295 commit 9b03307
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/helpers/Monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 9b03307

Please sign in to comment.