mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-07 07:31:53 -07:00
hooks: add pre connected/disconnected monitor events (#8503)
This commit is contained in:
@@ -39,6 +39,7 @@ CMonitor::~CMonitor() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CMonitor::onConnect(bool noRule) {
|
void CMonitor::onConnect(bool noRule) {
|
||||||
|
EMIT_HOOK_EVENT("preMonitorAdded", self.lock());
|
||||||
CScopeGuard x = {[]() { g_pCompositor->arrangeMonitors(); }};
|
CScopeGuard x = {[]() { g_pCompositor->arrangeMonitors(); }};
|
||||||
|
|
||||||
if (output->supportsExplicit) {
|
if (output->supportsExplicit) {
|
||||||
@@ -238,6 +239,7 @@ void CMonitor::onConnect(bool noRule) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CMonitor::onDisconnect(bool destroy) {
|
void CMonitor::onDisconnect(bool destroy) {
|
||||||
|
EMIT_HOOK_EVENT("preMonitorRemoved", self.lock());
|
||||||
CScopeGuard x = {[this]() {
|
CScopeGuard x = {[this]() {
|
||||||
if (g_pCompositor->m_bIsShuttingDown)
|
if (g_pCompositor->m_bIsShuttingDown)
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user