summaryrefslogtreecommitdiff
path: root/src/helpers/Monitor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers/Monitor.cpp')
-rw-r--r--src/helpers/Monitor.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp
index bff57c7e..2c0727c0 100644
--- a/src/helpers/Monitor.cpp
+++ b/src/helpers/Monitor.cpp
@@ -1503,21 +1503,22 @@ void CMonitor::setSpecialWorkspace(const PHLWORKSPACE& pWorkspace) {
bool wasActive = false;
//close if open elsewhere
- const auto PMONITORWORKSPACEOWNER = pWorkspace->m_monitor.lock();
- if (const auto PMWSOWNER = pWorkspace->m_monitor.lock(); PMWSOWNER && PMWSOWNER->m_activeSpecialWorkspace == pWorkspace) {
- PMWSOWNER->m_activeSpecialWorkspace.reset();
- g_layoutManager->recalculateMonitor(PMWSOWNER);
- g_pHyprRenderer->damageMonitor(PMWSOWNER);
- g_pEventManager->postEvent(SHyprIPCEvent{"activespecial", "," + PMWSOWNER->m_name});
- g_pEventManager->postEvent(SHyprIPCEvent{"activespecialv2", ",," + PMWSOWNER->m_name});
+ const auto PMONITOR = pWorkspace->m_monitor.lock();
+
+ if (PMONITOR && PMONITOR->m_activeSpecialWorkspace == pWorkspace) {
+ PMONITOR->m_activeSpecialWorkspace.reset();
+ g_layoutManager->recalculateMonitor(PMONITOR);
+ g_pHyprRenderer->damageMonitor(PMONITOR);
+ g_pEventManager->postEvent(SHyprIPCEvent{"activespecial", "," + PMONITOR->m_name});
+ g_pEventManager->postEvent(SHyprIPCEvent{"activespecialv2", ",," + PMONITOR->m_name});
// Reset layer surfaces on the old monitor when special workspace is stolen
for (auto const& ls : g_pCompositor->m_layers) {
- if (ls->m_monitor == PMWSOWNER)
+ if (ls->m_monitor == PMONITOR)
ls->m_aboveFullscreen = false;
}
- const auto PACTIVEWORKSPACE = PMWSOWNER->m_activeWorkspace;
+ const auto PACTIVEWORKSPACE = PMONITOR->m_activeWorkspace;
g_pDesktopAnimationManager->setFullscreenFadeAnimation(PACTIVEWORKSPACE,
PACTIVEWORKSPACE && PACTIVEWORKSPACE->m_hasFullscreenWindow ? CDesktopAnimationManager::ANIMATION_TYPE_IN :
CDesktopAnimationManager::ANIMATION_TYPE_OUT);
@@ -1539,7 +1540,7 @@ void CMonitor::setSpecialWorkspace(const PHLWORKSPACE& pWorkspace) {
if (POLDSPECIAL)
POLDSPECIAL->m_events.activeChanged.emit();
- if (PMONITORWORKSPACEOWNER != m_self)
+ if (PMONITOR != m_self)
pWorkspace->m_events.monitorChanged.emit();
if (!wasActive)