diff options
| author | Vaxry <vaxry@vaxry.net> | 2026-02-19 00:49:43 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2026-02-19 00:49:43 +0000 |
| commit | 68456a5d9a54f34b70a8261153dc7d35c17f2bf0 (patch) | |
| tree | bd6698c8a687a60a62c300706c0386f273948b7a /src/protocols/ForeignToplevel.cpp | |
| parent | 184af52f24c3267a4210239aba45a998404bb073 (diff) | |
desktop/window: add stable id and use it for foreign
Diffstat (limited to 'src/protocols/ForeignToplevel.cpp')
| -rw-r--r-- | src/protocols/ForeignToplevel.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/protocols/ForeignToplevel.cpp b/src/protocols/ForeignToplevel.cpp index 5515d2fb..93506410 100644 --- a/src/protocols/ForeignToplevel.cpp +++ b/src/protocols/ForeignToplevel.cpp @@ -54,26 +54,26 @@ void CForeignToplevelList::onMap(PHLWINDOW pWindow) { std::erase_if(m_handles, [&](const auto& other) { return other.get() == OLDHANDLE.get(); }); } - const auto NEWHANDLE = PROTO::foreignToplevel->m_handles.emplace_back( + auto newHandle = PROTO::foreignToplevel->m_handles.emplace_back( makeShared<CForeignToplevelHandle>(makeShared<CExtForeignToplevelHandleV1>(m_resource->client(), m_resource->version(), 0), pWindow)); - if (!NEWHANDLE->good()) { + if (!newHandle->good()) { LOGM(Log::ERR, "Couldn't create a foreign handle"); m_resource->noMemory(); PROTO::foreignToplevel->m_handles.pop_back(); return; } - const auto IDENTIFIER = std::format("{:08x}->{:016x}", sc<uint32_t>(rc<uintptr_t>(this) & 0xFFFFFFFF), rc<uintptr_t>(pWindow.get())); + const auto IDENTIFIER = std::format("{:x}", pWindow->m_stableID); LOGM(Log::DEBUG, "Newly mapped window gets an identifier of {}", IDENTIFIER); - m_resource->sendToplevel(NEWHANDLE->m_resource.get()); - NEWHANDLE->m_resource->sendIdentifier(IDENTIFIER.c_str()); - NEWHANDLE->m_resource->sendAppId(pWindow->m_initialClass.c_str()); - NEWHANDLE->m_resource->sendTitle(pWindow->m_initialTitle.c_str()); - NEWHANDLE->m_resource->sendDone(); + m_resource->sendToplevel(newHandle->m_resource.get()); + newHandle->m_resource->sendIdentifier(IDENTIFIER.c_str()); + newHandle->m_resource->sendAppId(pWindow->m_initialClass.c_str()); + newHandle->m_resource->sendTitle(pWindow->m_initialTitle.c_str()); + newHandle->m_resource->sendDone(); - m_handles.push_back(NEWHANDLE); + m_handles.emplace_back(std::move(newHandle)); } SP<CForeignToplevelHandle> CForeignToplevelList::handleForWindow(PHLWINDOW pWindow) { |
