summaryrefslogtreecommitdiff
path: root/src/Window.cpp
diff options
context:
space:
mode:
authormemchr <118117622+memchr@users.noreply.github.com>2023-09-10 21:59:10 +0000
committerGitHub <noreply@github.com>2023-09-10 22:59:10 +0100
commit79862c957cd83f5bbb42e2881b3cbcbc72941b78 (patch)
tree3a5b6655342e8df9e499744b7a6122f91daf1119 /src/Window.cpp
parent19bbdeed47cdf4423e745a201137c96d74beb8a6 (diff)
layout: add missing groupbar decoration to the window (#3235)
* fix: add missing groupbar decoration to the window Add groupbar decoration to the operand window of `CWindow::insertWindowToGroup` if it does not exist, to prevent segmentation faults when mouse events are triggered after moving the window to a group, where `getDecorationByType(DECORATION_GROUPBAR)` unexpectedly returns nullptr. Also fixed a bug where the group bar disappeared when the moveIntoGroup dispatcher's operand window was in a group. * Update Window.cpp
Diffstat (limited to 'src/Window.cpp')
-rw-r--r--src/Window.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Window.cpp b/src/Window.cpp
index 28e78350..832d84a9 100644
--- a/src/Window.cpp
+++ b/src/Window.cpp
@@ -733,6 +733,9 @@ void CWindow::insertWindowToGroup(CWindow* pWindow) {
const auto BEGINAT = this;
const auto ENDAT = m_sGroupData.pNextWindow;
+ if (!pWindow->getDecorationByType(DECORATION_GROUPBAR))
+ pWindow->m_dWindowDecorations.emplace_back(std::make_unique<CHyprGroupBarDecoration>(pWindow));
+
if (!pWindow->m_sGroupData.pNextWindow) {
BEGINAT->m_sGroupData.pNextWindow = pWindow;
pWindow->m_sGroupData.pNextWindow = ENDAT;