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