From 5d0919fcff3ee3e321b1a0b2f1e4a7c6db97f9a8 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 20 Mar 2022 12:11:57 +0100 Subject: handle layer popups --- src/Compositor.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/Compositor.cpp') diff --git a/src/Compositor.cpp b/src/Compositor.cpp index de01d35a..baa098b0 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -310,4 +310,18 @@ bool CCompositor::windowValidMapped(CWindow* pWindow) { return false; return true; +} + +SLayerSurface* CCompositor::getLayerForPopup(SLayerPopup* pPopup) { + auto CurrentPopup = pPopup; + while (CurrentPopup->parentPopup != nullptr) { + for (auto& p : g_pCompositor->m_lLayerPopups) { + if (p.popup == CurrentPopup->parentPopup) { + CurrentPopup = &p; + break; + } + } + } + + return CurrentPopup->parentSurface; } \ No newline at end of file -- cgit v1.2.3