diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2026-02-20 22:31:59 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-20 22:31:59 +0000 |
| commit | d91952c555085758117f1eb360d4ace120ee5d65 (patch) | |
| tree | 7bcf2d3b9454b075c0fc68b09f3c33e0f27b8a96 /src/protocols/ForeignToplevelWlr.cpp | |
| parent | 8b17a7404b70a5ca2383320167a88e03289f0211 (diff) | |
wayland/output: return all bound wl_output instances in outputResourceFrom (#13315)
ref https://github.com/hyprwm/Hyprland/discussions/13301
Diffstat (limited to 'src/protocols/ForeignToplevelWlr.cpp')
| -rw-r--r-- | src/protocols/ForeignToplevelWlr.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/protocols/ForeignToplevelWlr.cpp b/src/protocols/ForeignToplevelWlr.cpp index 5e18483d..89db1ad8 100644 --- a/src/protocols/ForeignToplevelWlr.cpp +++ b/src/protocols/ForeignToplevelWlr.cpp @@ -154,17 +154,23 @@ void CForeignToplevelHandleWlr::sendMonitor(PHLMONITOR pMonitor) { const auto CLIENT = m_resource->client(); if (const auto PLASTMONITOR = g_pCompositor->getMonitorFromID(m_lastMonitorID); PLASTMONITOR && PROTO::outputs.contains(PLASTMONITOR->m_name)) { - const auto OLDRESOURCE = PROTO::outputs.at(PLASTMONITOR->m_name)->outputResourceFrom(CLIENT); + const auto OLDRESOURCES = PROTO::outputs.at(PLASTMONITOR->m_name)->outputResourcesFrom(CLIENT); - if LIKELY (OLDRESOURCE) - m_resource->sendOutputLeave(OLDRESOURCE->getResource()->resource()); + if LIKELY (!OLDRESOURCES.empty()) { + for (const auto& r : OLDRESOURCES) { + m_resource->sendOutputLeave(r->getResource()->resource()); + } + } } if (PROTO::outputs.contains(pMonitor->m_name)) { - const auto NEWRESOURCE = PROTO::outputs.at(pMonitor->m_name)->outputResourceFrom(CLIENT); + const auto NEWRESOURCES = PROTO::outputs.at(pMonitor->m_name)->outputResourcesFrom(CLIENT); - if LIKELY (NEWRESOURCE) - m_resource->sendOutputEnter(NEWRESOURCE->getResource()->resource()); + if LIKELY (!NEWRESOURCES.empty()) { + for (const auto& r : NEWRESOURCES) { + m_resource->sendOutputEnter(r->getResource()->resource()); + } + } } m_lastMonitorID = pMonitor->m_id; |
