input: properly track xdg surfaces' geometry in vectorToSurfaceLocal

fixes #3703
This commit is contained in:
Vaxry 2023-10-30 19:36:34 +00:00
parent f48b3774a2
commit ab5497a0c9

View file

@ -865,10 +865,13 @@ Vector2D CCompositor::vectorToSurfaceLocal(const Vector2D& vec, CWindow* pWindow
},
&iterData);
wlr_box geom = {0};
wlr_xdg_surface_get_geometry(PSURFACE, &geom);
if (std::get<1>(iterData) == -1337 && std::get<2>(iterData) == -1337)
return vec - pWindow->m_vRealPosition.goalv();
return vec - pWindow->m_vRealPosition.goalv() - Vector2D{std::get<1>(iterData), std::get<2>(iterData)};
return vec - pWindow->m_vRealPosition.goalv() - Vector2D{std::get<1>(iterData), std::get<2>(iterData)} + Vector2D{geom.x, geom.y};
}
CMonitor* CCompositor::getMonitorFromOutput(wlr_output* out) {