From 7fde80f38eefef4ec1e682947c4ae152aa0974db Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 9 May 2023 17:01:18 +0100 Subject: layers: fix wonky focus on multimon --- src/events/Layers.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/events/Layers.cpp') diff --git a/src/events/Layers.cpp b/src/events/Layers.cpp index 56ab11ae..32c58f5d 100644 --- a/src/events/Layers.cpp +++ b/src/events/Layers.cpp @@ -111,8 +111,8 @@ void Events::listener_mapLayerSurface(void* owner, void* data) { layersurface->layerSurface->mapped = true; layersurface->mapped = true; - - layersurface->surface = layersurface->layerSurface->surface; + layersurface->keyboardExclusive = layersurface->layerSurface->current.keyboard_interactive; + layersurface->surface = layersurface->layerSurface->surface; // anim layersurface->alpha.setConfig(g_pConfigManager->getAnimationPropertyConfig("fadeIn")); @@ -325,7 +325,7 @@ void Events::listener_commitLayerSurface(void* owner, void* data) { if (layersurface->layerSurface->current.keyboard_interactive && (!g_pCompositor->m_sSeat.mouse || !g_pCompositor->m_sSeat.mouse->currentConstraint) // don't focus if constrained - && g_pCompositor->m_pLastFocus != layersurface->layerSurface->surface) { + && !layersurface->keyboardExclusive) { g_pCompositor->focusSurface(layersurface->layerSurface->surface); const auto LOCAL = @@ -333,10 +333,12 @@ void Events::listener_commitLayerSurface(void* owner, void* data) { 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) && - g_pCompositor->m_pLastFocus == layersurface->layerSurface->surface) { + layersurface->keyboardExclusive) { g_pInputManager->refocus(); } + layersurface->keyboardExclusive = layersurface->layerSurface->current.keyboard_interactive; + g_pHyprRenderer->damageSurface(layersurface->layerSurface->surface, layersurface->position.x, layersurface->position.y); g_pProtocolManager->m_pFractionalScaleProtocolManager->setPreferredScaleForSurface(layersurface->layerSurface->surface, PMONITOR->scale); -- cgit v1.2.3