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/desktop/view/Window.cpp | |
| parent | 184af52f24c3267a4210239aba45a998404bb073 (diff) | |
desktop/window: add stable id and use it for foreign
Diffstat (limited to 'src/desktop/view/Window.cpp')
| -rw-r--r-- | src/desktop/view/Window.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/desktop/view/Window.cpp b/src/desktop/view/Window.cpp index 30fb131d..7e1131b1 100644 --- a/src/desktop/view/Window.cpp +++ b/src/desktop/view/Window.cpp @@ -53,6 +53,10 @@ using enum NContentType::eContentType; using namespace Desktop; using namespace Desktop::View; +// I wish I had an elven wife instead of a windowIDCounter +static uint64_t windowIDCounter = 0x18000000; + +// PHLWINDOW CWindow::create(SP<CXWaylandSurface> surface) { PHLWINDOW pWindow = SP<CWindow>(new CWindow(surface)); @@ -105,7 +109,7 @@ PHLWINDOW CWindow::create(SP<CXDGSurfaceResource> resource) { return pWindow; } -CWindow::CWindow(SP<CXDGSurfaceResource> resource) : IView(CWLSurface::create()), m_xdgSurface(resource) { +CWindow::CWindow(SP<CXDGSurfaceResource> resource) : IView(CWLSurface::create()), m_xdgSurface(resource), m_stableID(windowIDCounter++) { m_listeners.map = m_xdgSurface->m_events.map.listen([this] { mapWindow(); }); m_listeners.ack = m_xdgSurface->m_events.ack.listen([this](uint32_t d) { onAck(d); }); m_listeners.unmap = m_xdgSurface->m_events.unmap.listen([this] { unmapWindow(); }); @@ -115,7 +119,7 @@ CWindow::CWindow(SP<CXDGSurfaceResource> resource) : IView(CWLSurface::create()) m_listeners.updateMetadata = m_xdgSurface->m_toplevel->m_events.metadataChanged.listen([this] { onUpdateMeta(); }); } -CWindow::CWindow(SP<CXWaylandSurface> surface) : IView(CWLSurface::create()), m_xwaylandSurface(surface) { +CWindow::CWindow(SP<CXWaylandSurface> surface) : IView(CWLSurface::create()), m_xwaylandSurface(surface), m_stableID(windowIDCounter++) { m_listeners.map = m_xwaylandSurface->m_events.map.listen([this] { mapWindow(); }); m_listeners.unmap = m_xwaylandSurface->m_events.unmap.listen([this] { unmapWindow(); }); m_listeners.destroy = m_xwaylandSurface->m_events.destroy.listen([this] { destroyWindow(); }); |
