aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2023-03-23 00:39:32 +0000
committervaxerski <[email protected]>2023-03-23 00:39:32 +0000
commita3fda12ba15286ee412c83a7137fc6cb14afa266 (patch)
tree57dd91d2605ce7d23acb85293abc4cc062de1e23
parent0268bb9888abf3d3e007960770f3a01385385702 (diff)
downloadHyprland-a3fda12ba15286ee412c83a7137fc6cb14afa266.tar.gz
Hyprland-a3fda12ba15286ee412c83a7137fc6cb14afa266.zip
window: unassign surface on unmap
-rw-r--r--src/Window.cpp2
-rw-r--r--src/helpers/WLSurface.cpp4
-rw-r--r--src/helpers/WLSurface.hpp1
3 files changed, 7 insertions, 0 deletions
diff --git a/src/Window.cpp b/src/Window.cpp
index 19fb68c2..840944d4 100644
--- a/src/Window.cpp
+++ b/src/Window.cpp
@@ -336,6 +336,8 @@ void CWindow::onUnmap() {
m_vRealSize.setCallbackOnBegin(nullptr);
std::erase_if(g_pCompositor->m_vWindowFocusHistory, [&](const auto& other) { return other == this; });
+
+ m_pWLSurface.unassign();
}
void CWindow::onMap() {
diff --git a/src/helpers/WLSurface.cpp b/src/helpers/WLSurface.cpp
index 38c31e1a..4bb35135 100644
--- a/src/helpers/WLSurface.cpp
+++ b/src/helpers/WLSurface.cpp
@@ -11,6 +11,10 @@ void CWLSurface::assign(wlr_surface* pSurface) {
init();
}
+void CWLSurface::unassign() {
+ destroy();
+}
+
CWLSurface::~CWLSurface() {
destroy();
}
diff --git a/src/helpers/WLSurface.hpp b/src/helpers/WLSurface.hpp
index 78c07673..e3325f99 100644
--- a/src/helpers/WLSurface.hpp
+++ b/src/helpers/WLSurface.hpp
@@ -9,6 +9,7 @@ class CWLSurface {
~CWLSurface();
void assign(wlr_surface* pSurface);
+ void unassign();
CWLSurface(const CWLSurface&) = delete;
CWLSurface(CWLSurface&&) = delete;