From 54f272ba1ebf4b090a186f27744722829ebf1462 Mon Sep 17 00:00:00 2001 From: Guilherme Pagano Date: Tue, 26 May 2026 12:23:10 -0300 Subject: [PATCH] fix(toast): align dimensions to whole pixels to avoid blurry rendering (#2494) The toast Rectangle uses `layer.enabled: true`, which renders to a texture before compositing. With fractional implicit/content sizes (derived from text and icon metrics), the cached texture was being sampled with sub-pixel interpolation and the toast looked blurry under fractional-scale-aware compositors (e.g., niri). Wrap toastWidth/toastHeight and implicitWidth/implicitHeight with Theme.px(value, dpr), matching the alignment NotificationPopup.qml already applies to its surface. --- quickshell/Modules/Toast.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/quickshell/Modules/Toast.qml b/quickshell/Modules/Toast.qml index 55c57e3b..82af63f5 100644 --- a/quickshell/Modules/Toast.qml +++ b/quickshell/Modules/Toast.qml @@ -50,8 +50,8 @@ PanelWindow { WlrLayershell.keyboardFocus: WlrKeyboardFocus.None color: "transparent" - readonly property real toastWidth: shouldBeVisible ? Math.min(900, messageText.implicitWidth + statusIcon.width + Theme.spacingM + (ToastService.hasDetails ? (expandButton.width + closeButton.width + 4) : (ToastService.currentLevel === ToastService.levelError ? closeButton.width + Theme.spacingS : 0)) + Theme.spacingL * 2 + Theme.spacingM * 2) : frozenWidth - readonly property real toastHeight: toastContent.height + Theme.spacingL * 2 + readonly property real toastWidth: shouldBeVisible ? Theme.px(Math.min(900, messageText.implicitWidth + statusIcon.width + Theme.spacingM + (ToastService.hasDetails ? (expandButton.width + closeButton.width + 4) : (ToastService.currentLevel === ToastService.levelError ? closeButton.width + Theme.spacingS : 0)) + Theme.spacingL * 2 + Theme.spacingM * 2), dpr) : frozenWidth + readonly property real toastHeight: Theme.px(toastContent.height + Theme.spacingL * 2, dpr) anchors { top: true @@ -63,8 +63,8 @@ PanelWindow { top: Math.max(0, Theme.snap(toastY - shadowBuffer, dpr)) } - implicitWidth: toastWidth + (shadowBuffer * 2) - implicitHeight: toastHeight + (shadowBuffer * 2) + implicitWidth: Theme.px(toastWidth + (shadowBuffer * 2), dpr) + implicitHeight: Theme.px(toastHeight + (shadowBuffer * 2), dpr) Rectangle { id: toast