fix(ags notif): fix hover and dismiss

This commit is contained in:
matt1432 2023-12-22 16:58:12 -05:00
parent 4da8a529e0
commit f8b0d3232e
2 changed files with 18 additions and 10 deletions

View file

@ -46,15 +46,19 @@ export default ({
const widget = EventBox({
...props,
cursor: 'grab',
on_hover: (self) => {
if (!self.attribute.hovered) {
self.attribute.hovered = true;
}
},
on_hover_lost: (self) => {
if (self.attribute.hovered) {
self.attribute.hovered = false;
}
setup: (self) => {
self
.on('leave-notify-event', () => {
if (self.attribute.hovered) {
self.attribute.hovered = false;
}
})
.on('enter-notify-event', () => {
if (!self.attribute.hovered) {
self.attribute.hovered = true;
}
});
},
attribute: {

View file

@ -25,7 +25,11 @@ export default () => Box({
if (notif) {
const NewNotif = Notification({
notif,
command: () => notif.dismiss(),
command: () => {
if (notif.popup) {
notif.dismiss();
}
},
});
if (NewNotif) {