diff --git a/quickshell/.config/quickshell/labfy-sway/notifications/NotificationToastArea.qml b/quickshell/.config/quickshell/labfy-sway/notifications/NotificationToastArea.qml index 326647805..e9a06ba21 100644 --- a/quickshell/.config/quickshell/labfy-sway/notifications/NotificationToastArea.qml +++ b/quickshell/.config/quickshell/labfy-sway/notifications/NotificationToastArea.qml @@ -15,24 +15,40 @@ PopupWindow { anchor.edges: Edges.Top | Edges.Left anchor.gravity: Edges.Bottom | Edges.Right implicitWidth: 386 - implicitHeight: Math.min(550, stack.implicitHeight + 16) + // WHY: redimensionner un popup Wayland déjà visible peut présenter un + // ancien buffer étiré pendant que Qt recalcule les cartes. La surface + // garde sa taille ; seule la pile interne suit les notifications. + // INVARIANT: hauteur native indépendante des arrivées et expirations. + implicitHeight: 550 visible: service.toasts.length > 0 grabFocus: false color: "transparent" - Column { - id: stack + // CONTRACT: la partie transparente ne capte pas les clics du bureau. + mask: Region { item: viewport } + Flickable { + id: viewport anchors.left: parent.left anchors.right: parent.right anchors.top: parent.top anchors.margins: 8 - spacing: 7 - Repeater { - model: area.service.toasts.slice(-4).reverse() - delegate: NotificationToast { - required property var modelData - entry: modelData - service: area.service - width: stack.width + height: Math.min(area.height - 16, contentHeight) + contentWidth: width + contentHeight: stack.childrenRect.height + clip: true + interactive: contentHeight > height + boundsBehavior: Flickable.StopAtBounds + Column { + id: stack + width: viewport.width + spacing: 7 + Repeater { + model: area.service.toasts.slice(-4).reverse() + delegate: NotificationToast { + required property var modelData + entry: modelData + service: area.service + width: stack.width + } } } }