From 2bfda39fc841434ffc229327a1ec2e11650c4db8 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Wed, 18 Dec 2024 14:51:18 +0000 Subject: [PATCH] hyprbars: manually detect pointer focus fixes #248 --- hyprbars/barDeco.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hyprbars/barDeco.cpp b/hyprbars/barDeco.cpp index 99dbf87..a2ce012 100644 --- a/hyprbars/barDeco.cpp +++ b/hyprbars/barDeco.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include "globals.hpp" @@ -55,7 +56,12 @@ std::string CHyprBar::getDisplayName() { } void CHyprBar::onMouseDown(SCallbackInfo& info, IPointer::SButtonEvent e) { - if (m_pWindow.lock() != g_pCompositor->m_pLastWindow.lock()) + if (!m_pWindow->m_pWorkspace->isVisible() || !g_pInputManager->m_dExclusiveLSes.empty() || (g_pSeatManager->seatGrab && !g_pSeatManager->seatGrab->accepts(m_pWindow->m_pWLSurface->resource()))) + return; + + const auto WINDOWATCURSOR = g_pCompositor->vectorToWindowUnified(g_pInputManager->getMouseCoordsInternal(), RESERVED_EXTENTS | INPUT_EXTENTS | ALLOW_FLOATING); + + if (WINDOWATCURSOR != m_pWindow && m_pWindow != g_pCompositor->m_pLastWindow) return; const auto PWINDOW = m_pWindow.lock();