diff options
| author | Vaxry <vaxry@vaxry.net> | 2023-11-11 15:18:04 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2023-11-11 15:18:17 +0000 |
| commit | bea828ea4585bab206b8772b838f496e0eada12e (patch) | |
| tree | fa03be2903d8270b307fa1a3e0389fe65a4bb505 /src/events/Windows.cpp | |
| parent | c5d1faf72dc5e7e4fa357007974ced0f573f1f32 (diff) | |
decoration-positioner: improve extent handling
Diffstat (limited to 'src/events/Windows.cpp')
| -rw-r--r-- | src/events/Windows.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index c6c9024e..00d78f4c 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -668,6 +668,13 @@ void Events::listener_unmapWindow(void* owner, void* data) { return; } + const auto PMONITOR = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID); + if (PMONITOR) { + PWINDOW->m_vOriginalClosedPos = PWINDOW->m_vRealPosition.vec() - PMONITOR->vecPosition; + PWINDOW->m_vOriginalClosedSize = PWINDOW->m_vRealSize.vec(); + PWINDOW->m_eOriginalClosedExtents = PWINDOW->getFullWindowExtents(); + } + g_pEventManager->postEvent(SHyprIPCEvent{"closewindow", std::format("{:x}", PWINDOW)}); EMIT_HOOK_EVENT("closeWindow", PWINDOW); @@ -697,13 +704,6 @@ void Events::listener_unmapWindow(void* owner, void* data) { if (PWINDOW->m_bIsFullscreen) g_pCompositor->setWindowFullscreen(PWINDOW, false, FULLSCREEN_FULL); - const auto PMONITOR = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID); - if (PMONITOR) { - PWINDOW->m_vOriginalClosedPos = PWINDOW->m_vRealPosition.vec() - PMONITOR->vecPosition; - PWINDOW->m_vOriginalClosedSize = PWINDOW->m_vRealSize.vec(); - PWINDOW->m_eOriginalClosedExtents = PWINDOW->getFullWindowExtents(); - } - // Allow the renderer to catch the last frame. g_pHyprOpenGL->makeWindowSnapshot(PWINDOW); |
