diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-06-09 19:47:05 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-06-09 21:39:03 +0200 |
| commit | 53146ccf69a53850f8ad2af85f0ccf6e1143b878 (patch) | |
| tree | ac9f4c3fba02368164fb15d45936852e4b4e3a45 /src/managers/input/Tablets.cpp | |
| parent | 506977c13d118feedffb7b7fc10d5b16e5400f78 (diff) | |
oopsie
Diffstat (limited to 'src/managers/input/Tablets.cpp')
| -rw-r--r-- | src/managers/input/Tablets.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/managers/input/Tablets.cpp b/src/managers/input/Tablets.cpp index bb2c5c6d..d21ef518 100644 --- a/src/managers/input/Tablets.cpp +++ b/src/managers/input/Tablets.cpp @@ -213,24 +213,27 @@ void CInputManager::focusTablet(STablet* pTab, wlr_tablet_tool* pTool, bool moti const auto LOCAL = CURSORPOS - PWINDOW->m_vRealPosition.goalv(); - if (PTOOL->wlrTabletToolV2->focused_surface != g_pCompositor->m_pLastFocus) + if (PTOOL->pSurface != g_pCompositor->m_pLastFocus) wlr_tablet_v2_tablet_tool_notify_proximity_out(PTOOL->wlrTabletToolV2); - if (g_pCompositor->m_pLastFocus) + if (g_pCompositor->m_pLastFocus) { + PTOOL->pSurface = g_pCompositor->m_pLastFocus; wlr_tablet_v2_tablet_tool_notify_proximity_in(PTOOL->wlrTabletToolV2, pTab->wlrTabletV2, g_pCompositor->m_pLastFocus); + } if (motion) wlr_tablet_v2_tablet_tool_notify_motion(PTOOL->wlrTabletToolV2, LOCAL.x, LOCAL.y); } else { - wlr_tablet_v2_tablet_tool_notify_proximity_out(PTOOL->wlrTabletToolV2); + if (PTOOL->pSurface) + wlr_tablet_v2_tablet_tool_notify_proximity_out(PTOOL->wlrTabletToolV2); } } void CInputManager::unfocusAllTablets() { for (auto& tt : m_lTabletTools) { - if (!tt.wlrTabletTool->data) + if (!tt.wlrTabletToolV2 || !tt.pSurface || !tt.active) continue; - wlr_tablet_v2_tablet_tool_notify_proximity_out(((STabletTool*)tt.wlrTabletTool->data)->wlrTabletToolV2); + wlr_tablet_v2_tablet_tool_notify_proximity_out(tt.wlrTabletToolV2); } }
\ No newline at end of file |
