diff options
author | vaxerski <[email protected]> | 2023-07-10 13:32:57 +0200 |
---|---|---|
committer | vaxerski <[email protected]> | 2023-07-10 13:32:57 +0200 |
commit | 382af06406e39640dac36e4e075c2c70063cb16c (patch) | |
tree | f936ff5766029163fc0e9db24cf1389f02986de1 | |
parent | 515a363ecd8f870fb5df4f3b4d9666e1f2c26952 (diff) | |
download | Hyprland-382af06406e39640dac36e4e075c2c70063cb16c.tar.gz Hyprland-382af06406e39640dac36e4e075c2c70063cb16c.zip |
render: resize subsurfaces with size resizes
-rw-r--r-- | src/render/Renderer.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index da47142c..59f935b1 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -15,8 +15,14 @@ void renderSurface(struct wlr_surface* surface, int x, int y, void* data) { wlr_box windowBox; if (RDATA->surface && surface == RDATA->surface) windowBox = {(int)outputX + RDATA->x + x, (int)outputY + RDATA->y + y, RDATA->w, RDATA->h}; - else // here we clamp to 2, these might be some tiny specks + else { // here we clamp to 2, these might be some tiny specks windowBox = {(int)outputX + RDATA->x + x, (int)outputY + RDATA->y + y, std::max(surface->current.width, 2), std::max(surface->current.height, 2)}; + if (RDATA->pWindow && RDATA->pWindow->m_vRealSize.isBeingAnimated() && RDATA->surface && RDATA->surface != surface && RDATA->squishOversized /* subsurface */) { + // adjust subsurfaces to the window + windowBox.width = (windowBox.width / RDATA->pWindow->m_vReportedSize.x) * RDATA->pWindow->m_vRealSize.vec().x; + windowBox.height = (windowBox.height / RDATA->pWindow->m_vReportedSize.y) * RDATA->pWindow->m_vRealSize.vec().y; + } + } if (RDATA->squishOversized) { if (x + windowBox.width > RDATA->w) |