diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-03-10 16:56:32 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-03-10 16:56:42 +0000 |
| commit | 0c28d4e334532e8a8edacf36bcaf4e6b973ea398 (patch) | |
| tree | a8b192615ac5f424606bc18ed76f2d0ddeaa2cc5 /src/Window.cpp | |
| parent | 335506d5557b91a0baf974750c353443841e691b (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.cpp | 7 |
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); } } |
