protocols/xdg-shell: fix crash on null parent in pin (#12694)
This commit is contained in:
parent
c87a1a7629
commit
712bcfbce5
1 changed files with 4 additions and 3 deletions
|
|
@ -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()) : ""));
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue