mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-09 23:05:59 +01:00
fix invalidating the deque in CHyprGroupBarDeco
This commit is contained in:
parent
dd422abb33
commit
6f5b8425cb
3 changed files with 17 additions and 12 deletions
|
@ -77,6 +77,18 @@ wlr_box CWindow::getWindowIdealBoundingBoxIgnoreReserved() {
|
||||||
void CWindow::updateWindowDecos() {
|
void CWindow::updateWindowDecos() {
|
||||||
for (auto& wd : m_dWindowDecorations)
|
for (auto& wd : m_dWindowDecorations)
|
||||||
wd->updateWindow(this);
|
wd->updateWindow(this);
|
||||||
|
|
||||||
|
for (auto& wd : m_vDecosToRemove) {
|
||||||
|
for (auto it = m_dWindowDecorations.begin(); it != m_dWindowDecorations.end(); it++) {
|
||||||
|
if (it->get() == wd) {
|
||||||
|
it = m_dWindowDecorations.erase(it);
|
||||||
|
if (it == m_dWindowDecorations.end())
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_vDecosToRemove.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
pid_t CWindow::getPID() {
|
pid_t CWindow::getPID() {
|
||||||
|
|
|
@ -99,6 +99,7 @@ public:
|
||||||
|
|
||||||
// Window decorations
|
// Window decorations
|
||||||
std::deque<std::unique_ptr<IHyprWindowDecoration>> m_dWindowDecorations;
|
std::deque<std::unique_ptr<IHyprWindowDecoration>> m_dWindowDecorations;
|
||||||
|
std::vector<IHyprWindowDecoration*> m_vDecosToRemove;
|
||||||
|
|
||||||
// Special render data, rules, etc
|
// Special render data, rules, etc
|
||||||
SWindowSpecialRenderData m_sSpecialRenderData;
|
SWindowSpecialRenderData m_sSpecialRenderData;
|
||||||
|
|
|
@ -40,12 +40,8 @@ void CHyprGroupBarDecoration::updateWindow(CWindow* pWindow) {
|
||||||
|
|
||||||
if (g_pLayoutManager->getCurrentLayout()->getLayoutName() != "dwindle") {
|
if (g_pLayoutManager->getCurrentLayout()->getLayoutName() != "dwindle") {
|
||||||
// ????
|
// ????
|
||||||
for (auto it = pWindow->m_dWindowDecorations.begin(); it != pWindow->m_dWindowDecorations.end(); it++) {
|
m_pWindow->m_vDecosToRemove.push_back(this);
|
||||||
if (it->get() == this) {
|
return;
|
||||||
pWindow->m_dWindowDecorations.erase(it);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the group info
|
// get the group info
|
||||||
|
@ -58,12 +54,8 @@ void CHyprGroupBarDecoration::updateWindow(CWindow* pWindow) {
|
||||||
|
|
||||||
if (m_dwGroupMembers.size() == 0) {
|
if (m_dwGroupMembers.size() == 0) {
|
||||||
// remove
|
// remove
|
||||||
for (auto it = pWindow->m_dWindowDecorations.begin(); it != pWindow->m_dWindowDecorations.end(); it++) {
|
m_pWindow->m_vDecosToRemove.push_back(this);
|
||||||
if (it->get() == this) {
|
return;
|
||||||
pWindow->m_dWindowDecorations.erase(it);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue