From 52c09196219313aec2ec1d3d543669bff834d746 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sat, 5 Oct 2024 14:41:44 +0100 Subject: [PATCH] monitor: arrange monitors on connect and disconnect --- src/helpers/Monitor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index f105ea66..c6cef41f 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -36,6 +36,7 @@ CMonitor::~CMonitor() { } void CMonitor::onConnect(bool noRule) { + CScopeGuard x = {[]() { g_pCompositor->arrangeMonitors(); }}; if (output->supportsExplicit) { inTimeline = CSyncTimeline::create(output->getBackend()->drmFD()); @@ -234,6 +235,7 @@ void CMonitor::onDisconnect(bool destroy) { return; g_pEventManager->postEvent(SHyprIPCEvent{"monitorremoved", szName}); EMIT_HOOK_EVENT("monitorRemoved", this); + g_pCompositor->arrangeMonitors(); }}; if (renderTimer) {