diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-04-02 13:02:16 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-04-02 13:02:16 +0200 |
| commit | 4db773b1e7d51cd008ae24f4c457710e8360fef7 (patch) | |
| tree | ea4eef4525593111bc8c8fcfe17445a6f8b727f6 /src/managers/InputManager.cpp | |
| parent | ca2459e56331d7522a5e05bb258e06ad30388968 (diff) | |
Fix popups focus on native GDK
Diffstat (limited to 'src/managers/InputManager.cpp')
| -rw-r--r-- | src/managers/InputManager.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/managers/InputManager.cpp b/src/managers/InputManager.cpp index e7723fbb..4c66c7bf 100644 --- a/src/managers/InputManager.cpp +++ b/src/managers/InputManager.cpp @@ -68,9 +68,12 @@ void CInputManager::mouseMoveUnified(uint32_t time) { // then windows const auto PWINDOWIDEAL = g_pCompositor->vectorToWindowIdeal(mouseCoords); if (!foundSurface && PWINDOWIDEAL) { - foundSurface = g_pXWaylandManager->getWindowSurface(PWINDOWIDEAL); - if (foundSurface) + if (!PWINDOWIDEAL->m_bIsX11) { + foundSurface = g_pCompositor->vectorWindowToSurface(mouseCoords, PWINDOWIDEAL, surfaceCoords); + } else { + foundSurface = g_pXWaylandManager->getWindowSurface(PWINDOWIDEAL); surfacePos = PWINDOWIDEAL->m_vRealPosition; + } } // then surfaces below @@ -97,7 +100,7 @@ void CInputManager::mouseMoveUnified(uint32_t time) { wlr_seat_pointer_notify_enter(g_pCompositor->m_sSeat.seat, foundSurface, surfaceLocal.x, surfaceLocal.y); wlr_seat_pointer_notify_motion(g_pCompositor->m_sSeat.seat, time, surfaceLocal.x, surfaceLocal.y); - g_pCompositor->focusSurface(foundSurface); + g_pCompositor->focusSurface(foundSurface, PWINDOWIDEAL ? PWINDOWIDEAL : nullptr); g_pLayoutManager->getCurrentLayout()->onMouseMove(getMouseCoordsInternal()); } @@ -109,6 +112,8 @@ void CInputManager::onMouseButton(wlr_pointer_button_event* e) { switch (e->state) { case WLR_BUTTON_PRESSED: + refocus(); + if ((e->button == BTN_LEFT || e->button == BTN_RIGHT) && wlr_keyboard_get_modifiers(PKEYBOARD) == (uint32_t)g_pConfigManager->getInt("general:main_mod_internal")) { currentlyDraggedWindow = g_pCompositor->windowFloatingFromCursor(); dragButton = e->button; |
