From 3d1b255199db3ce9539befcd8547331b312a34e7 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Tue, 3 Jan 2023 13:06:13 +0100 Subject: [PATCH] update constraint on constraint state region commit --- src/managers/XWaylandManager.cpp | 2 +- src/managers/input/InputManager.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp index feb4c2ff..029a3f31 100644 --- a/src/managers/XWaylandManager.cpp +++ b/src/managers/XWaylandManager.cpp @@ -243,7 +243,7 @@ void CHyprXWaylandManager::checkBorders(CWindow* pWindow) { } } - if (pWindow->m_uSurface.xwayland->parent || pWindow->m_iX11Type == 2) { + if (pWindow->m_iX11Type == 2) { pWindow->m_bX11DoesntWantBorders = true; } } diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index ec2446b1..c67bcba3 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -1041,6 +1041,16 @@ void Events::listener_commitConstraint(void* owner, void* data) { PCONSTRAINT->hintSet = true; } } + + if (PMOUSE->currentConstraint->current.committed & WLR_POINTER_CONSTRAINT_V1_STATE_REGION) { + if (pixman_region32_not_empty(&PMOUSE->currentConstraint->current.region)) { + pixman_region32_intersect(&PMOUSE->currentConstraint->region, &PMOUSE->currentConstraint->surface->input_region, &PMOUSE->currentConstraint->current.region); + } else { + pixman_region32_copy(&PMOUSE->currentConstraint->region, &PMOUSE->currentConstraint->surface->input_region); + } + + g_pInputManager->recheckConstraint(PMOUSE); + } } void CInputManager::updateCapabilities() {