aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2022-11-06 18:10:53 +0000
committervaxerski <[email protected]>2022-11-06 18:10:53 +0000
commitefbc3f819459da9f50ed4e22d648c222ea5c7ec1 (patch)
tree833adee6a8ac22d756d7586b9e45bb7713dca470
parentf755351511a44f6477ac36b6d9ae2cc3164f163d (diff)
downloadHyprland-efbc3f819459da9f50ed4e22d648c222ea5c7ec1.tar.gz
Hyprland-efbc3f819459da9f50ed4e22d648c222ea5c7ec1.zip
resize transition fixes + default transitions to false
-rw-r--r--src/config/ConfigManager.cpp2
-rw-r--r--src/render/Renderer.cpp51
2 files changed, 27 insertions, 26 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index 40653a80..8de3639d 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -105,7 +105,7 @@ void CConfigManager::setDefaultVars() {
configValues["master:no_gaps_when_only"].intValue = 0;
configValues["animations:enabled"].intValue = 1;
- configValues["animations:use_resize_transitions"].intValue = 1;
+ configValues["animations:use_resize_transitions"].intValue = 0;
configValues["animations:speed"].floatValue = 7.f;
configValues["animations:curve"].strValue = "default";
configValues["animations:windows_style"].strValue = STRVAL_EMPTY;
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index baa8dcb3..f90b729b 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -261,33 +261,34 @@ void CHyprRenderer::renderWindow(CWindow* pWindow, CMonitor* pMonitor, timespec*
// clip box for animated offsets
Vector2D offset;
- 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;
- const auto WINBB = pWindow->getFullWindowBoundingBox();
-
- 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 (PWORKSPACE->m_vRenderOffset.vec().y) {
- const auto PWSMON = g_pCompositor->getMonitorFromID(PWORKSPACE->m_iMonitorID);
- const auto PROGRESS = PWORKSPACE->m_vRenderOffset.vec().y / PWSMON->vecSize.y;
- const auto WINBB = pWindow->getFullWindowBoundingBox();
-
- 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;
+ if (!ignorePosition) {
+ 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;
+ const auto WINBB = pWindow->getFullWindowBoundingBox();
+
+ 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 (PWORKSPACE->m_vRenderOffset.vec().y) {
+ const auto PWSMON = g_pCompositor->getMonitorFromID(PWORKSPACE->m_iMonitorID);
+ const auto PROGRESS = PWORKSPACE->m_vRenderOffset.vec().y / PWSMON->vecSize.y;
+ const auto WINBB = pWindow->getFullWindowBoundingBox();
+
+ 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;
+ }
}
- }
-
- renderdata.x += offset.x;
- renderdata.y += offset.y;
+ renderdata.x += offset.x;
+ renderdata.y += offset.y;
+ }
+
// render window decorations first, if not fullscreen full
-
if (mode == RENDER_PASS_ALL || mode == RENDER_PASS_MAIN) {
if (!pWindow->m_bIsFullscreen || PWORKSPACE->m_efFullscreenMode != FULLSCREEN_FULL) for (auto& wd : pWindow->m_dWindowDecorations)
wd->draw(pMonitor, renderdata.alpha * renderdata.fadeAlpha / 255.f, offset);
@@ -298,7 +299,7 @@ void CHyprRenderer::renderWindow(CWindow* pWindow, CMonitor* pMonitor, timespec*
const auto PFB = g_pHyprOpenGL->m_mWindowResizeFramebuffers.find(pWindow);
if (PFB != g_pHyprOpenGL->m_mWindowResizeFramebuffers.end() && PFB->second.isAllocated()) {
- wlr_box box = {renderdata.x, renderdata.y, renderdata.w, renderdata.h};
+ wlr_box box = {renderdata.x - pMonitor->vecPosition.x, renderdata.y - pMonitor->vecPosition.y, renderdata.w, renderdata.h};
// adjust UV (remove when I figure out how to change the size of the fb)
g_pHyprOpenGL->m_RenderData.primarySurfaceUVTopLeft = {0, 0};