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:
parent
46585667db
commit
031c8d2166
1 changed files with 14 additions and 17 deletions
|
|
@ -516,7 +516,7 @@ in
|
|||
signal notificationReceived()
|
||||
|
||||
NotificationServer {
|
||||
id: notifServer
|
||||
id: _notifServer
|
||||
bodySupported: true
|
||||
actionsSupported: true
|
||||
imageSupported: true
|
||||
|
|
@ -533,18 +533,14 @@ in
|
|||
model: Quickshell.screens
|
||||
|
||||
Bar {
|
||||
notifServer: notifServer
|
||||
notifServer: _notifServer
|
||||
}
|
||||
}
|
||||
|
||||
Variants {
|
||||
model: Quickshell.screens
|
||||
|
||||
NotificationToast {
|
||||
shellRoot: root
|
||||
}
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
@ -1725,24 +1721,26 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function show(notification) {
|
||||
currentNotif = notification;
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue