3
0
mirror of https://github.com/hyprwm/Hyprland.git synced 2025-10-29 11:22:47 +00:00

ext-foreign-toplevel: remove stale entries when remapping (#12037)

This commit is contained in:
Virt 2025-10-15 14:37:39 +02:00 committed by GitHub
parent e40873be51
commit ab11af9664
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -45,6 +45,15 @@ void CForeignToplevelList::onMap(PHLWINDOW pWindow) {
if UNLIKELY (m_finished)
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(
makeShared<CForeignToplevelHandle>(makeShared<CExtForeignToplevelHandleV1>(m_resource->client(), m_resource->version(), 0), pWindow));