aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2022-11-16 15:17:01 +0000
committervaxerski <[email protected]>2022-11-16 15:35:36 +0000
commit878a20741bc38a5b4fff3d3947a39049c6a72be0 (patch)
treefc840b21626f8d50593aa996ae1cbb800d59cd3e
parentd5eafe192649b290fd587b41f772887058f7418b (diff)
downloadHyprland-878a20741bc38a5b4fff3d3947a39049c6a72be0.tar.gz
Hyprland-878a20741bc38a5b4fff3d3947a39049c6a72be0.zip
fix slide calcs for windows outside the viewport
-rw-r--r--src/render/Renderer.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index aed7d212..978c58c2 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -261,7 +261,7 @@ void CHyprRenderer::renderWindow(CWindow* pWindow, CMonitor* pMonitor, timespec*
// clip box for animated offsets
Vector2D offset;
- if (!ignorePosition) {
+ if (!ignorePosition && pWindow->m_bIsFloating) {
if (PWORKSPACE->m_vRenderOffset.vec().x != 0) {
const auto PWSMON = g_pCompositor->getMonitorFromID(PWORKSPACE->m_iMonitorID);
const auto PROGRESS = PWORKSPACE->m_vRenderOffset.vec().x / PWSMON->vecSize.x;
@@ -269,8 +269,8 @@ void CHyprRenderer::renderWindow(CWindow* pWindow, CMonitor* pMonitor, timespec*
if (WINBB.x < PWSMON->vecPosition.x) {
offset.x = (PWSMON->vecPosition.x - WINBB.x) * PROGRESS;
- } else if (WINBB.x > PWSMON->vecPosition.x + PWSMON->vecSize.x) {
- offset.x = (WINBB.x - PWSMON->vecPosition.x + PWSMON->vecSize.x) * PROGRESS;
+ } else if (WINBB.x + WINBB.width > PWSMON->vecPosition.x + PWSMON->vecSize.x) {
+ offset.x = (WINBB.x + WINBB.width - PWSMON->vecPosition.x - PWSMON->vecSize.x) * PROGRESS;
}
} else if (PWORKSPACE->m_vRenderOffset.vec().y) {
const auto PWSMON = g_pCompositor->getMonitorFromID(PWORKSPACE->m_iMonitorID);
@@ -279,8 +279,8 @@ void CHyprRenderer::renderWindow(CWindow* pWindow, CMonitor* pMonitor, timespec*
if (WINBB.y < PWSMON->vecPosition.y) {
offset.y = (PWSMON->vecPosition.y - WINBB.y) * PROGRESS;
- } else if (WINBB.y > PWSMON->vecPosition.y + PWSMON->vecSize.y) {
- offset.y = (WINBB.y - PWSMON->vecPosition.y + PWSMON->vecSize.y) * PROGRESS;
+ } else if (WINBB.y + WINBB.height > PWSMON->vecPosition.y + PWSMON->vecSize.y) {
+ offset.y = (WINBB.y + WINBB.width - PWSMON->vecPosition.y - PWSMON->vecSize.y) * PROGRESS;
}
}