diff options
author | Vaxry <[email protected]> | 2023-03-20 15:00:58 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2023-03-20 15:00:58 +0000 |
commit | 788a8f7c134a34085d683e44a328e344be6b21f3 (patch) | |
tree | bed90c82b3c3e65722b5f1f97a6d04240ad3c7fc /src/Compositor.cpp | |
parent | d23bbd1687a5413fb7f2c08b67692d4e64f8efef (diff) | |
download | Hyprland-788a8f7c134a34085d683e44a328e344be6b21f3.tar.gz Hyprland-788a8f7c134a34085d683e44a328e344be6b21f3.zip |
internal: wrap wlr surfaces (#1822)
Diffstat (limited to 'src/Compositor.cpp')
-rw-r--r-- | src/Compositor.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index e4040f01..924de252 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -872,7 +872,7 @@ void CCompositor::focusWindow(CWindow* pWindow, wlr_surface* pSurface) { m_pLastWindow = PLASTWINDOW; - const auto PWINDOWSURFACE = pSurface ? pSurface : g_pXWaylandManager->getWindowSurface(pWindow); + const auto PWINDOWSURFACE = pSurface ? pSurface : pWindow->m_pWLSurface.wlr(); focusSurface(PWINDOWSURFACE, pWindow); @@ -926,8 +926,7 @@ void CCompositor::focusWindow(CWindow* pWindow, wlr_surface* pSurface) { void CCompositor::focusSurface(wlr_surface* pSurface, CWindow* pWindowOwner) { - if (m_sSeat.seat->keyboard_state.focused_surface == pSurface || - (pWindowOwner && m_sSeat.seat->keyboard_state.focused_surface == g_pXWaylandManager->getWindowSurface(pWindowOwner))) + if (m_sSeat.seat->keyboard_state.focused_surface == pSurface || (pWindowOwner && m_sSeat.seat->keyboard_state.focused_surface == pWindowOwner->m_pWLSurface.wlr())) return; // Don't focus when already focused on this. if (g_pSessionLockManager->isSessionLocked()) { @@ -1038,7 +1037,7 @@ CWindow* CCompositor::getWindowFromSurface(wlr_surface* pSurface) { if (!w->m_bIsMapped || w->m_bFadingOut || !w->m_bMappedX11) continue; - if (g_pXWaylandManager->getWindowSurface(w.get()) == pSurface) + if (w->m_pWLSurface.wlr() == pSurface) return w.get(); } @@ -1188,7 +1187,7 @@ bool CCompositor::isWindowActive(CWindow* pWindow) { if (!windowValidMapped(pWindow)) return false; - const auto PSURFACE = g_pXWaylandManager->getWindowSurface(pWindow); + const auto PSURFACE = pWindow->m_pWLSurface.wlr(); return PSURFACE == m_pLastFocus || pWindow == m_pLastWindow; } @@ -1525,11 +1524,11 @@ CWindow* CCompositor::getConstraintWindow(SMouse* pMouse) { const auto PSURFACE = pMouse->currentConstraint->surface; for (auto& w : m_vWindows) { - if (w->isHidden() || !w->m_bMappedX11 || !w->m_bIsMapped || !g_pXWaylandManager->getWindowSurface(w.get())) + if (w->isHidden() || !w->m_bMappedX11 || !w->m_bIsMapped || !w->m_pWLSurface.exists()) continue; if (w->m_bIsX11) { - if (PSURFACE == g_pXWaylandManager->getWindowSurface(w.get())) + if (PSURFACE == w->m_pWLSurface.wlr()) return w.get(); } else { std::pair<wlr_surface*, bool> check = {PSURFACE, false}; |