diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-03-19 02:45:11 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-03-19 02:45:11 +0000 |
| commit | 7a31c954e5962db07b1b83e8a7340c38e7988ab6 (patch) | |
| tree | bea7d2854ce6acb38ad40573eabd66cd9a55d431 /src/managers/input/Tablets.cpp | |
| parent | 49f5fd59adbef25dc2c97364690fe747c8cc09e8 (diff) | |
tablet: minor focus fixes
ref #3004
Diffstat (limited to 'src/managers/input/Tablets.cpp')
| -rw-r--r-- | src/managers/input/Tablets.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/managers/input/Tablets.cpp b/src/managers/input/Tablets.cpp index f692620c..387212c7 100644 --- a/src/managers/input/Tablets.cpp +++ b/src/managers/input/Tablets.cpp @@ -39,7 +39,8 @@ void CInputManager::newTabletTool(wlr_input_device* pDevice) { switch (EVENT->tool->type) { case WLR_TABLET_TOOL_TYPE_MOUSE: wlr_cursor_move(g_pCompositor->m_sWLRCursor, PTAB->wlrDevice, EVENT->dx, EVENT->dy); - g_pInputManager->refocus(); + g_pInputManager->simulateMouseMovement(); + g_pInputManager->focusTablet(PTAB, EVENT->tool, true); g_pInputManager->m_tmrLastCursorMovement.reset(); break; default: @@ -53,7 +54,8 @@ void CInputManager::newTabletTool(wlr_input_device* pDevice) { else wlr_cursor_warp_absolute(g_pCompositor->m_sWLRCursor, PTAB->wlrDevice, x, y); - g_pInputManager->refocus(); + g_pInputManager->simulateMouseMovement(); + g_pInputManager->focusTablet(PTAB, EVENT->tool, true); g_pInputManager->m_tmrLastCursorMovement.reset(); break; } @@ -62,7 +64,7 @@ void CInputManager::newTabletTool(wlr_input_device* pDevice) { // TODO: this might be wrong if (PTOOL->active) { - g_pInputManager->refocus(); + g_pInputManager->simulateMouseMovement(); g_pInputManager->focusTablet(PTAB, EVENT->tool, true); } @@ -105,7 +107,7 @@ void CInputManager::newTabletTool(wlr_input_device* pDevice) { // TODO: this might be wrong if (EVENT->state == WLR_TABLET_TOOL_TIP_DOWN) { - g_pInputManager->refocus(); + g_pInputManager->simulateMouseMovement(); g_pInputManager->focusTablet(PTAB, EVENT->tool); wlr_send_tablet_v2_tablet_tool_down(PTOOL->wlrTabletToolV2); } else { @@ -146,7 +148,7 @@ void CInputManager::newTabletTool(wlr_input_device* pDevice) { } else { PTOOL->active = true; - g_pInputManager->refocus(); + g_pInputManager->simulateMouseMovement(); g_pInputManager->focusTablet(PTAB, EVENT->tool); } @@ -258,12 +260,12 @@ void CInputManager::focusTablet(STablet* pTab, wlr_tablet_tool* pTool, bool moti if (const auto PWINDOW = g_pCompositor->m_pLastWindow; PWINDOW) { const auto CURSORPOS = g_pInputManager->getMouseCoordsInternal(); - if (PTOOL->pSurface != g_pCompositor->m_pLastFocus) + if (PTOOL->pSurface != g_pInputManager->m_pLastMouseSurface) wlr_tablet_v2_tablet_tool_notify_proximity_out(PTOOL->wlrTabletToolV2); - if (g_pCompositor->m_pLastFocus) { + if (g_pInputManager->m_pLastMouseSurface) { PTOOL->pSurface = g_pCompositor->m_pLastFocus; - wlr_tablet_v2_tablet_tool_notify_proximity_in(PTOOL->wlrTabletToolV2, pTab->wlrTabletV2, g_pCompositor->m_pLastFocus); + wlr_tablet_v2_tablet_tool_notify_proximity_in(PTOOL->wlrTabletToolV2, pTab->wlrTabletV2, g_pInputManager->m_pLastMouseSurface); } if (motion) { |
