keybinds: fix mouse pass (#6652)

* keybinds: fix mouse pass

* keybinds: keep mouse and keyboard focus separate after pass bind
This commit is contained in:
Gregory 2024-06-25 06:46:49 -05:00 committed by GitHub
parent eef207ce0a
commit 784c0b5ccb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2026,7 +2026,8 @@ void CKeybindManager::pass(std::string regexp) {
} }
const auto XWTOXW = PWINDOW->m_bIsX11 && g_pCompositor->m_pLastWindow.lock() && g_pCompositor->m_pLastWindow->m_bIsX11; const auto XWTOXW = PWINDOW->m_bIsX11 && g_pCompositor->m_pLastWindow.lock() && g_pCompositor->m_pLastWindow->m_bIsX11;
const auto LASTSRF = g_pCompositor->m_pLastFocus.lock(); const auto LASTMOUSESURF = g_pSeatManager->state.pointerFocus.lock();
const auto LASTKBSURF = g_pSeatManager->state.keyboardFocus.lock();
// pass all mf shit // pass all mf shit
if (!XWTOXW) { if (!XWTOXW) {
@ -2078,9 +2079,9 @@ void CKeybindManager::pass(std::string regexp) {
const auto SL = PWINDOW->m_vRealPosition.goal() - g_pInputManager->getMouseCoordsInternal(); const auto SL = PWINDOW->m_vRealPosition.goal() - g_pInputManager->getMouseCoordsInternal();
if (g_pKeybindManager->m_uLastCode != 0) if (g_pKeybindManager->m_uLastCode != 0)
g_pSeatManager->setKeyboardFocus(LASTSRF); g_pSeatManager->setKeyboardFocus(LASTKBSURF);
else else
g_pSeatManager->setPointerFocus(PWINDOW->m_pWLSurface->resource(), SL); g_pSeatManager->setPointerFocus(LASTMOUSESURF, SL);
} }
void CKeybindManager::sendshortcut(std::string args) { void CKeybindManager::sendshortcut(std::string args) {