diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-03-28 20:17:47 +0100 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-03-28 20:17:47 +0100 |
| commit | d6241a3086c4abfd21e91e23c83c97c3f80123d4 (patch) | |
| tree | 81e739849af94411fd2f161639698746878ec58d /src/Window.cpp | |
| parent | df54ab40ceb6e7f74844e83d3f55739accd349cc (diff) | |
windows: only connect unmap when mapped
Diffstat (limited to 'src/Window.cpp')
| -rw-r--r-- | src/Window.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Window.cpp b/src/Window.cpp index b8c7ab36..681de391 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -338,6 +338,8 @@ void CWindow::onUnmap() { std::erase_if(g_pCompositor->m_vWindowFocusHistory, [&](const auto& other) { return other == this; }); m_pWLSurface.unassign(); + + hyprListener_unmapWindow.removeCallback(); } void CWindow::onMap() { @@ -369,6 +371,8 @@ void CWindow::onMap() { m_fBorderAngleAnimationProgress = 1.f; g_pCompositor->m_vWindowFocusHistory.push_back(this); + + hyprListener_unmapWindow.initCallback(m_bIsX11 ? &m_uSurface.xwayland->events.unmap : &m_uSurface.xdg->events.unmap, &Events::listener_unmapWindow, this, "CWindow"); } void CWindow::onBorderAngleAnimEnd(void* ptr) { |
