mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-23 03:29:48 +01:00
fix subsurface UV handling on oversized windows
This commit is contained in:
parent
f5f99c6700
commit
5726f394b1
1 changed files with 3 additions and 1 deletions
|
@ -410,6 +410,8 @@ void CHyprRenderer::calculateUVForWindowSurface(CWindow* pWindow, wlr_surface* p
|
||||||
wlr_box geom;
|
wlr_box geom;
|
||||||
wlr_xdg_surface_get_geometry(pWindow->m_uSurface.xdg, &geom);
|
wlr_xdg_surface_get_geometry(pWindow->m_uSurface.xdg, &geom);
|
||||||
|
|
||||||
|
const auto SUBSURFACE = g_pXWaylandManager->getWindowSurface(pWindow) != pSurface && main;
|
||||||
|
|
||||||
// wp_viewporter_v1 implementation
|
// wp_viewporter_v1 implementation
|
||||||
if (pSurface->current.viewport.has_src) {
|
if (pSurface->current.viewport.has_src) {
|
||||||
wlr_fbox bufferSource;
|
wlr_fbox bufferSource;
|
||||||
|
@ -450,7 +452,7 @@ void CHyprRenderer::calculateUVForWindowSurface(CWindow* pWindow, wlr_surface* p
|
||||||
return; // ignore the rest
|
return; // ignore the rest
|
||||||
|
|
||||||
// then, if the surface is too big, modify the pos UV
|
// then, if the surface is too big, modify the pos UV
|
||||||
if (geom.width > pWindow->m_vRealSize.vec().x + 1 || geom.height > pWindow->m_vRealSize.vec().y + 1) {
|
if ((geom.width > pWindow->m_vRealSize.vec().x + 1 || geom.height > pWindow->m_vRealSize.vec().y + 1) && !SUBSURFACE) {
|
||||||
const auto OFF = Vector2D(pWindow->m_vRealSize.vec().x / (double)geom.width, pWindow->m_vRealSize.vec().y / (double)geom.height);
|
const auto OFF = Vector2D(pWindow->m_vRealSize.vec().x / (double)geom.width, pWindow->m_vRealSize.vec().y / (double)geom.height);
|
||||||
|
|
||||||
if (g_pHyprOpenGL->m_RenderData.primarySurfaceUVTopLeft == Vector2D(-1, -1))
|
if (g_pHyprOpenGL->m_RenderData.primarySurfaceUVTopLeft == Vector2D(-1, -1))
|
||||||
|
|
Loading…
Reference in a new issue