From 642af5395e19d696be0cbf217a92d2a1e723e17a Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 14 Jul 2022 21:33:36 +0200 Subject: [PATCH] dont focus anything on constrained --- src/events/Layers.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/events/Layers.cpp b/src/events/Layers.cpp index 45f20870..0e2f49d5 100644 --- a/src/events/Layers.cpp +++ b/src/events/Layers.cpp @@ -99,8 +99,6 @@ void Events::listener_mapLayerSurface(void* owner, void* data) { layersurface->layerSurface->mapped = true; - wlr_surface_send_enter(layersurface->layerSurface->surface, layersurface->layerSurface->output); - // fix if it changed its mon const auto PMONITOR = g_pCompositor->getMonitorFromOutput(layersurface->layerSurface->output); @@ -118,13 +116,14 @@ void Events::listener_mapLayerSurface(void* owner, void* data) { g_pHyprRenderer->arrangeLayersForMonitor(PMONITOR->ID); - 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_pCompositor->m_sSeat.mouse->currentConstraint)) { // don't focus if constrained + wlr_surface_send_enter(layersurface->layerSurface->surface, layersurface->layerSurface->output); g_pCompositor->focusSurface(layersurface->layerSurface->surface); - // mouse enter always, keeb only when needed - const auto LOCAL = 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); + const auto LOCAL = 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); + } layersurface->position = Vector2D(layersurface->geometry.x, layersurface->geometry.y);