summaryrefslogtreecommitdiff
path: root/src/protocols/XDGShell.cpp
diff options
context:
space:
mode:
authorUjinT34 <41110182+UjinT34@users.noreply.github.com>2025-12-21 16:21:51 +0300
committerGitHub <noreply@github.com>2025-12-21 14:21:51 +0100
commit712bcfbce58a6d352833325bb901fbcf7b58c136 (patch)
tree32d669abbd80147ab544062bdaa9279bfedc76d1 /src/protocols/XDGShell.cpp
parentc87a1a7629c4796a1998a1b26c9097c82e21291b (diff)
protocols/xdg-shell: fix crash on null parent in pin (#12694)
Diffstat (limited to 'src/protocols/XDGShell.cpp')
-rw-r--r--src/protocols/XDGShell.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/protocols/XDGShell.cpp b/src/protocols/XDGShell.cpp
index ebb56342..969556a3 100644
--- a/src/protocols/XDGShell.cpp
+++ b/src/protocols/XDGShell.cpp
@@ -257,11 +257,12 @@ CXDGToplevelResource::CXDGToplevelResource(SP<CXdgToplevel> resource_, SP<CXDGSu
m_parent = newp;
- if (m_parent)
+ if (m_parent) {
m_parent->m_children.emplace_back(m_self);
- if (m_parent->m_window->m_pinned)
- m_self->m_window->m_pinned = true;
+ if (m_parent->m_window && m_parent->m_window->m_pinned)
+ m_self->m_window->m_pinned = true;
+ }
LOGM(Log::DEBUG, "Toplevel {:x} sets parent to {:x}{}", (uintptr_t)this, (uintptr_t)newp.get(), (oldParent ? std::format(" (was {:x})", (uintptr_t)oldParent.get()) : ""));
});