diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-10-28 19:20:12 +0100 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-10-28 19:20:12 +0100 |
| commit | 1759b0483c42421e5e99f4a26b7bb11648407c42 (patch) | |
| tree | 2785a1bb4d39a3fddefd146b7c8b17c0717ce53e /src/Compositor.cpp | |
| parent | f7174acc4850ac93feb291707de9d9861c9fab56 (diff) | |
constrain mouse on focus change
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index fccd43c2..499c3fd7 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -779,6 +779,14 @@ void CCompositor::focusWindow(CWindow* pWindow, wlr_surface* pSurface) { if (pWindow->m_phForeignToplevel) wlr_foreign_toplevel_handle_v1_set_activated(pWindow->m_phForeignToplevel, true); + + if (!pWindow->m_bIsX11) { + const auto PCONSTRAINT = wlr_pointer_constraints_v1_constraint_for_surface(m_sWLRPointerConstraints, pWindow->m_uSurface.xdg->surface, m_sSeat.seat); + + if (PCONSTRAINT) + g_pInputManager->constrainMouse(m_sSeat.mouse, PCONSTRAINT); + } + } void CCompositor::focusSurface(wlr_surface* pSurface, CWindow* pWindowOwner) { |
