From d72ea5f2a7fdb0d0a7bf914412327195b05199b0 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Sat, 2 Mar 2024 21:04:55 +0000 Subject: input: Rewritten pointer constraints (#4889) * rewritten constraints * send pointer enter on activate if not pointer focus * minor cleanup * simulate movement on commit * don't ignore oneshot prop * various fixes * dont send motion on confined * update pos hint on region change --- src/events/Layers.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/events/Layers.cpp') diff --git a/src/events/Layers.cpp b/src/events/Layers.cpp index 2d94f1ed..ad65f8fb 100644 --- a/src/events/Layers.cpp +++ b/src/events/Layers.cpp @@ -144,7 +144,7 @@ void Events::listener_mapLayerSurface(void* owner, void* data) { const bool GRABSFOCUS = layersurface->layerSurface->current.keyboard_interactive != ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_NONE && // don't focus if constrained - (!g_pCompositor->m_sSeat.mouse || !g_pCompositor->m_sSeat.mouse->currentConstraint); + (!g_pCompositor->m_sSeat.mouse || !g_pInputManager->isConstrained()); if (GRABSFOCUS) { g_pCompositor->focusSurface(layersurface->layerSurface->surface); @@ -340,8 +340,7 @@ void Events::listener_commitLayerSurface(void* owner, void* data) { layersurface->realSize.setValueAndWarp(layersurface->geometry.size()); } - if (layersurface->layerSurface->current.keyboard_interactive && - (!g_pCompositor->m_sSeat.mouse || !g_pCompositor->m_sSeat.mouse->currentConstraint) // don't focus if constrained + if (layersurface->layerSurface->current.keyboard_interactive && (!g_pCompositor->m_sSeat.mouse || !g_pInputManager->isConstrained()) // don't focus if constrained && !layersurface->keyboardExclusive && layersurface->mapped) { g_pCompositor->focusSurface(layersurface->layerSurface->surface); @@ -349,7 +348,7 @@ void Events::listener_commitLayerSurface(void* owner, void* data) { g_pInputManager->getMouseCoordsInternal() - Vector2D(layersurface->geometry.x + PMONITOR->vecPosition.x, layersurface->geometry.y + PMONITOR->vecPosition.y); wlr_seat_pointer_notify_enter(g_pCompositor->m_sSeat.seat, layersurface->layerSurface->surface, LOCAL.x, LOCAL.y); wlr_seat_pointer_notify_motion(g_pCompositor->m_sSeat.seat, 0, LOCAL.x, LOCAL.y); - } else if (!layersurface->layerSurface->current.keyboard_interactive && (!g_pCompositor->m_sSeat.mouse || !g_pCompositor->m_sSeat.mouse->currentConstraint) && + } else if (!layersurface->layerSurface->current.keyboard_interactive && (!g_pCompositor->m_sSeat.mouse || !g_pInputManager->isConstrained()) && layersurface->keyboardExclusive) { g_pInputManager->refocus(); } -- cgit v1.2.3