mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-26 17:33:48 -07:00
input: fix force_zero_scaling for tablet and touch (#3644)
* Attempt to fix force_zero_scaling for tablet and touch for XWayland apps. * Formated using clang-format. * Simpler way to compute touch origin.
This commit is contained in:
@@ -244,8 +244,6 @@ 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();
|
||||
|
||||
const auto LOCAL = CURSORPOS - PWINDOW->m_vRealPosition.goalv();
|
||||
|
||||
if (PTOOL->pSurface != g_pCompositor->m_pLastFocus)
|
||||
wlr_tablet_v2_tablet_tool_notify_proximity_out(PTOOL->wlrTabletToolV2);
|
||||
|
||||
@@ -254,8 +252,14 @@ void CInputManager::focusTablet(STablet* pTab, wlr_tablet_tool* pTool, bool moti
|
||||
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);
|
||||
if (motion) {
|
||||
auto local = CURSORPOS - PWINDOW->m_vRealPosition.goalv();
|
||||
|
||||
if (PWINDOW->m_bIsX11)
|
||||
local = local * PWINDOW->m_fX11SurfaceScaledBy;
|
||||
|
||||
wlr_tablet_v2_tablet_tool_notify_motion(PTOOL->wlrTabletToolV2, local.x, local.y);
|
||||
}
|
||||
} else {
|
||||
if (PTOOL->pSurface)
|
||||
wlr_tablet_v2_tablet_tool_notify_proximity_out(PTOOL->wlrTabletToolV2);
|
||||
|
Reference in New Issue
Block a user