quickshell: fix toast and notifServer binding issues

Use PanelWindow with overlay layer instead of PopupWindow for toast.
Rename notifServer id to avoid binding loop with Bar property.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
rope 2026-05-26 20:45:08 +01:00
parent 46585667db
commit 031c8d2166

View file

@ -516,7 +516,7 @@ in
signal notificationReceived()
NotificationServer {
id: notifServer
id: _notifServer
bodySupported: true
actionsSupported: true
imageSupported: true
@ -533,16 +533,12 @@ in
model: Quickshell.screens
Bar {
notifServer: notifServer
notifServer: _notifServer
}
}
Variants {
model: Quickshell.screens
NotificationToast {
shellRoot: root
}
NotificationToast {
shellRoot: root
}
}
'';
@ -1725,22 +1721,24 @@ in
onChange = qsRestart;
text = ''
import Quickshell
import Quickshell.Wayland
import QtQuick
PopupWindow {
PanelWindow {
id: notifToast
required property var modelData
required property var shellRoot
screen: modelData
screen: Quickshell.screens[0]
property var currentNotif: null
property bool open: false
WlrLayershell.layer: WlrLayer.Overlay
WlrLayershell.namespace: "quickshell-toast"
exclusionMode: ExclusionMode.Ignore
Connections {
target: shellRoot
function onNotificationReceived() {
if (notifToast.modelData === Quickshell.screens[0]) {
notifToast.show(shellRoot.latestNotification);
}
notifToast.show(shellRoot.latestNotification);
}
}
@ -1756,9 +1754,8 @@ in
_toastCloseDelay.start();
}
anchor.rect.x: (screen ? screen.width / 2 : 0) - 160
anchor.rect.y: 30
anchor.edges: Edges.Top | Edges.Left
anchors.top: true
margins.top: 30
visible: false
implicitWidth: 320
implicitHeight: toastContent.height + 2