aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVaxry <[email protected]>2023-11-03 19:07:11 +0000
committerVaxry <[email protected]>2023-11-03 19:12:09 +0000
commit9d2a5fb41752c0dcc8e863d7e98b541656584dd9 (patch)
treefbb8a9eb5d1d494b523e9149bf80562622ac704c
parented3d5053b23d2b725cda507cb5fcc9e9a2f35ba9 (diff)
downloadHyprland-9d2a5fb41752c0dcc8e863d7e98b541656584dd9.tar.gz
Hyprland-9d2a5fb41752c0dcc8e863d7e98b541656584dd9.zip
renderer: improvements to wayland surface small() detection
-rw-r--r--src/helpers/WLSurface.cpp2
-rw-r--r--src/render/Renderer.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/helpers/WLSurface.cpp b/src/helpers/WLSurface.cpp
index ffd764a1..33109b94 100644
--- a/src/helpers/WLSurface.cpp
+++ b/src/helpers/WLSurface.cpp
@@ -31,7 +31,7 @@ bool CWLSurface::small() const {
if (!m_pOwner || !exists())
return false;
- return m_pOwner->m_vReportedSize.x > m_pWLRSurface->current.buffer_width || m_pOwner->m_vReportedSize.y > m_pWLRSurface->current.buffer_height;
+ return std::abs(m_pOwner->m_vReportedSize.x - m_pWLRSurface->current.buffer_width) > 1 || std::abs(m_pOwner->m_vReportedSize.y - m_pWLRSurface->current.buffer_height) > 1;
}
Vector2D CWLSurface::correctSmallVec() const {
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 72ad3db7..79aabc6e 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -341,6 +341,7 @@ void CHyprRenderer::renderWindow(CWindow* pWindow, CMonitor* pMonitor, timespec*
const auto REALPOS = pWindow->m_vRealPosition.vec() + (pWindow->m_bPinned ? Vector2D{} : PWORKSPACE->m_vRenderOffset.vec());
static auto* const PDIMAROUND = &g_pConfigManager->getConfigValuePtr("decoration:dim_around")->floatValue;
static auto* const PBORDERSIZE = &g_pConfigManager->getConfigValuePtr("general:border_size")->intValue;
+ static auto* const PBLUR = &g_pConfigManager->getConfigValuePtr("decoration:blur:enabled")->intValue;
SRenderData renderdata = {pMonitor, time, REALPOS.x, REALPOS.y};
if (ignorePosition) {
@@ -432,7 +433,7 @@ void CHyprRenderer::renderWindow(CWindow* pWindow, CMonitor* pMonitor, timespec*
if ((pWindow->m_bIsX11 && *PXWLUSENN) || pWindow->m_sAdditionalConfigData.nearestNeighbor.toUnderlying())
g_pHyprOpenGL->m_RenderData.useNearestNeighbor = true;
- if (pWindow->m_pWLSurface.small() && !pWindow->m_pWLSurface.m_bFillIgnoreSmall && renderdata.blur) {
+ if (pWindow->m_pWLSurface.small() && !pWindow->m_pWLSurface.m_bFillIgnoreSmall && renderdata.blur && *PBLUR) {
wlr_box wb = {renderdata.x - pMonitor->vecPosition.x, renderdata.y - pMonitor->vecPosition.y, renderdata.w, renderdata.h};
scaleBox(&wb, pMonitor->scale);
g_pHyprOpenGL->renderRectWithBlur(&wb, CColor(0, 0, 0, 0), renderdata.dontRound ? 0 : renderdata.rounding - 1);