When a plasmoid collapses in Active state, the popup is hidden. In Passive state, however, one is returned to the hidden items list, as it cannot tell whether the plasmoid collapsed on its own or because the user clicked the same one in the hidden items list again.
When we clear notifications, plasmoid state updates immediately as a result of model signals, and when we then try to collapse the plasmoid we're already hidden and just returned to the hidden items list.
This patch addresses this by delaying the state change slightly. Futhermore, don't collapse the plasmoid when already hidden as that would just return the user to the hidden items list.
Details
Details
- Reviewers
mart - Group Reviewers
Plasma - Commits
- R120:90a69a7b508a: [Notifications] Improve self-closing behavior
I tried fixing that in System Tray but as I said there's no way for it to tell whether the plasmoid hid "on its own" or because the user clicked it again as the compact rep entirely governs this behavior when expanded. :/ It's ugly but I don't really see a better way.
- Got a notification, clicked rung bell, cleared it - system tray popup properly closed now
- Got a notification, opened tray (to mark it as read, plasmoid became passive), closed tray, opened again, cleared it - system tray popup stayed where it was now, previously it would just pointlessly get me to the hidden items list
- Verified that initial plasmoid state was correct (started normally is passive, started with dnd was active immediately)
Diff Detail
Diff Detail
- Repository
- R120 Plasma Workspace
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.