From ace13d7c180f0746dd94f41edf41a5cc020fb410 Mon Sep 17 00:00:00 2001 From: bbedward Date: Thu, 24 Sep 2026 12:07:40 -0400 Subject: [PATCH] popout: never round the body below its content height fixes #3558 --- quickshell/Common/Theme.qml | 6 ++++++ quickshell/Services/CompositorService.qml | 9 +++++++-- quickshell/Widgets/DankPopoutHost.qml | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/quickshell/Common/Theme.qml b/quickshell/Common/Theme.qml index b473ee9b8..4f0cf20c1 100644 --- a/quickshell/Common/Theme.qml +++ b/quickshell/Common/Theme.qml @@ -2238,6 +2238,12 @@ Singleton { return Math.round(value * s) / s; } + // the epsilon keeps a value already on the grid from gaining a pixel through float error + function pxCeil(value, dpr) { + const s = dpr || 1; + return Math.ceil(value * s - 0.001) / s; + } + function barWidgetThickness(innerPadding, dpr) { return snapEven(Math.max(20, 26 + innerPadding * 0.6), dpr); } diff --git a/quickshell/Services/CompositorService.qml b/quickshell/Services/CompositorService.qml index 3b112b75f..4d166021b 100644 --- a/quickshell/Services/CompositorService.qml +++ b/quickshell/Services/CompositorService.qml @@ -313,6 +313,11 @@ Singleton { }, 0, 3000); } + // wlr-output reports wl_fixed (1/256 steps), surfaces render at fractional-scale-v1 N/120 + function fractionalScale(fixedScale) { + return Math.round(fixedScale * 120) / 120; + } + function getScreenScale(screen) { if (!screen) return 1; @@ -323,12 +328,12 @@ Singleton { const randrScale = randrScales[screen.name]; if (randrScale !== undefined && randrScale > 0) - return Math.round(randrScale * 20) / 20; + return fractionalScale(randrScale); if (WlrOutputService.wlrOutputAvailable && screen) { const wlrOutput = WlrOutputService.getOutput(screen.name); if (wlrOutput?.enabled && wlrOutput.scale !== undefined && wlrOutput.scale > 0) { - return Math.round(wlrOutput.scale * 20) / 20; + return fractionalScale(wlrOutput.scale); } } diff --git a/quickshell/Widgets/DankPopoutHost.qml b/quickshell/Widgets/DankPopoutHost.qml index b6e7bf6ab..92d84276d 100644 --- a/quickshell/Widgets/DankPopoutHost.qml +++ b/quickshell/Widgets/DankPopoutHost.qml @@ -794,7 +794,7 @@ Item { readonly property real shadowMotionPadding: directionalRevealActive ? 0 : Math.max(0, animationOffset) readonly property real shadowBuffer: Theme.snap(Math.max(popoutHandle.surfacePadding, shadowRenderPadding + shadowMotionPadding), dpr) readonly property real alignedWidth: Theme.px(popupWidth, dpr) - readonly property real alignedHeight: Theme.px(popupHeight, dpr) + readonly property real alignedHeight: Theme.pxCeil(popupHeight, dpr) readonly property real surfaceBodyWidth: Math.max(alignedWidth, Theme.px(Math.min(minimumSurfaceWidth, screenWidth), dpr)) readonly property real surfaceBodyX: Theme.snap(_standaloneAlignedXFor(surfaceBodyWidth), dpr) readonly property real _surfaceOriginX: connected ? 0 : _surfaceX