diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index 1c1521c9..d4717f8b 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -652,6 +652,9 @@ void Events::listener_mapWindow(void* owner, void* data) { PWINDOW->m_vReportedSize = PWINDOW->m_vPendingReportedSize; g_pCompositor->updateWorkspaceWindows(PWINDOW->m_iWorkspaceID); + + if (PMONITOR && PWINDOW->m_iX11Type == 2) + PWINDOW->m_fX11SurfaceScaledBy = PMONITOR->scale; } void Events::listener_unmapWindow(void* owner, void* data) { @@ -1057,6 +1060,8 @@ void Events::listener_configureX11(void* owner, void* data) { wlr_xwayland_surface_configure(PWINDOW->m_uSurface.xwayland, E->x, E->y, E->width, E->height); PWINDOW->m_vPendingReportedSize = {E->width, E->height}; PWINDOW->m_vReportedSize = {E->width, E->height}; + if (const auto PMONITOR = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID); PMONITOR) + PWINDOW->m_fX11SurfaceScaledBy = PMONITOR->scale; return; } @@ -1081,8 +1086,10 @@ void Events::listener_configureX11(void* owner, void* data) { static auto* const PXWLFORCESCALEZERO = (Hyprlang::INT* const*)g_pConfigManager->getConfigValuePtr("xwayland:force_zero_scaling"); if (**PXWLFORCESCALEZERO) { - if (const auto PMONITOR = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID); PMONITOR) + if (const auto PMONITOR = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID); PMONITOR) { PWINDOW->m_vRealSize.setValueAndWarp(PWINDOW->m_vRealSize.goalv() / PMONITOR->scale); + PWINDOW->m_fX11SurfaceScaledBy = PMONITOR->scale; + } } PWINDOW->m_vPosition = PWINDOW->m_vRealPosition.vec(); diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index d356cd90..ca75c3b5 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -470,7 +470,7 @@ void CHyprRenderer::renderWindow(CWindow* pWindow, CMonitor* pMonitor, timespec* } 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) { + } else if (PWORKSPACE->m_vRenderOffset.vec().y != 0) { 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();