diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2022-12-12 14:56:42 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-12 14:56:42 +0000 |
| commit | 111d209bff5448c3a55e07f344cf89715536bba4 (patch) | |
| tree | 4b21cff5e0e3a52eac48b9b8fb39b50b0c4c9417 /src/Compositor.cpp | |
| parent | b45a2134135d6d6269ba374372c93361c799d6b8 (diff) | |
Added toplevel handle sharing Rev2 (#1203)
* Added toplevel handle sharing
* nix: fix build
* update hyprland-protocols
Co-authored-by: Mihai Fufezan <fufexan@protonmail.com>
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 942da2ee..8b415bd2 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -931,6 +931,23 @@ CWindow* CCompositor::getWindowFromHandle(uint32_t handle) { return nullptr; } +CWindow* CCompositor::getWindowFromZWLRHandle(wl_resource* handle) { + for (auto& w : m_vWindows) { + if (!w->m_bIsMapped || w->isHidden() || !w->m_phForeignToplevel) + continue; + + wl_resource* current; + + wl_list_for_each(current, &w->m_phForeignToplevel->resources, link) { + if (current == handle) { + return w.get(); + } + } + } + + return nullptr; +} + CWindow* CCompositor::getFullscreenWindowOnWorkspace(const int& ID) { for (auto& w : m_vWindows) { if (w->m_iWorkspaceID == ID && w->m_bIsFullscreen) |
