ext-foreign-toplevel: remove stale entries when remapping (#12037)
This commit is contained in:
parent
e40873be51
commit
ab11af9664
1 changed files with 9 additions and 0 deletions
|
|
@ -45,6 +45,15 @@ void CForeignToplevelList::onMap(PHLWINDOW pWindow) {
|
||||||
if UNLIKELY (m_finished)
|
if UNLIKELY (m_finished)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// check if the window already had a handle in the past
|
||||||
|
const auto OLDHANDLE = handleForWindow(pWindow);
|
||||||
|
if (OLDHANDLE) {
|
||||||
|
if (!OLDHANDLE->m_closed)
|
||||||
|
OLDHANDLE->m_resource->sendClosed();
|
||||||
|
|
||||||
|
std::erase_if(m_handles, [&](const auto& other) { return other.get() == OLDHANDLE.get(); });
|
||||||
|
}
|
||||||
|
|
||||||
const auto NEWHANDLE = PROTO::foreignToplevel->m_handles.emplace_back(
|
const auto NEWHANDLE = PROTO::foreignToplevel->m_handles.emplace_back(
|
||||||
makeShared<CForeignToplevelHandle>(makeShared<CExtForeignToplevelHandleV1>(m_resource->client(), m_resource->version(), 0), pWindow));
|
makeShared<CForeignToplevelHandle>(makeShared<CExtForeignToplevelHandleV1>(m_resource->client(), m_resource->version(), 0), pWindow));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue