notifications: Don't factor action drawer state in expiry

Currently opening the action drawer causes notification popups to
"expire", causing some unintended behaviour (ex. dismiss alarm/timer).

This commit removes this behaviour, and also fixes notification popup
expiry while the action drawer is open.

Fixes https://invent.kde.org/plasma/plasma-mobile/-/issues/468
This commit is contained in:
Devin Lin 2025-06-13 00:05:51 -04:00
parent a83e99ae8c
commit 7f8c9f8d5e

View file

@ -50,7 +50,6 @@ Item {
onTriggered: {
visible = true;
updateNotificationPopups();
checkActionDrawerOpened();
}
}
@ -73,7 +72,7 @@ Item {
}
return true;
}
onTriggered: notificationPopup.closePopup(popupIndex)
onTriggered: notificationPopup.closePopup(popupIndex);
}
// the value of how much time is left, normalized from 1 to 0
@ -180,9 +179,6 @@ Item {
popupNotifications.currentPopupIndex = popupIndex;
}
}
// if the action drawer opens, it is best to dismiss all popup notifications
onIsActionDrawerOpenChanged: checkActionDrawerOpened()
property bool isActionDrawerOpen: MobileShellState.ShellDBusClient.isActionDrawerOpen
property bool waiting: true
@ -214,16 +210,6 @@ Item {
return model.timeout;
}
// check if the action drawer is opened and the popup is fully created
// if so, close the popup with a scale effect
function checkActionDrawerOpened() {
if (isActionDrawerOpen && popupNotifications.objectAt(popupIndex)) {
notificationPopup.expired();
keyboardInteractivity = LayerShell.Window.KeyboardInteractivityNone;
notificationItem.state = "closeWithScale";
}
}
// show the top most notification in the list and move the rest to the popup drawer
function updateNotificationPopups() {
if (popupCount != 1) {
@ -520,7 +506,7 @@ Item {
notificationPopup.preventDismissTimeout = true;
if (notificationPopup.dismissTimeout) {
notificationPopup.dismissClicked();
} else if (!notificationPopup.isActionDrawerOpen) {
} else {
notificationPopup.expired();
}
}