summaryrefslogtreecommitdiff
path: root/src/Window.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-03-10 16:56:32 +0000
committerVaxry <vaxry@vaxry.net>2024-03-10 16:56:42 +0000
commit0c28d4e334532e8a8edacf36bcaf4e6b973ea398 (patch)
treea8b192615ac5f424606bc18ed76f2d0ddeaa2cc5 /src/Window.cpp
parent335506d5557b91a0baf974750c353443841e691b (diff)
window: prevent vector modification segfault while iterating
oops, updateWindow can modify the vec
Diffstat (limited to 'src/Window.cpp')
-rw-r--r--src/Window.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Window.cpp b/src/Window.cpp
index c63209a0..4c8ff509 100644
--- a/src/Window.cpp
+++ b/src/Window.cpp
@@ -194,7 +194,14 @@ void CWindow::updateWindowDecos() {
m_vDecosToRemove.clear();
+ // make a copy because updateWindow can remove decos.
+ std::vector<IHyprWindowDecoration*> decos;
+
for (auto& wd : m_dWindowDecorations) {
+ decos.push_back(wd.get());
+ }
+
+ for (auto& wd : decos) {
wd->updateWindow(this);
}
}