diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2024-03-02 21:04:55 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-02 21:04:55 +0000 |
| commit | d72ea5f2a7fdb0d0a7bf914412327195b05199b0 (patch) | |
| tree | 0ebc3bb4c8320e88cfa9010d314122c9533dcc0e /src/events/Layers.cpp | |
| parent | 328ab431655f207a5ee59737291f8e8d85fab992 (diff) | |
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
Diffstat (limited to 'src/events/Layers.cpp')
| -rw-r--r-- | src/events/Layers.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
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(); } |
