Bug 481247

Summary: Popup hide setting does not honour browsers' `requireInteraction: true` property on desktop notifications
Product: [Plasma] plasmashell Reporter: pallaswept <pallaswept>
Component: NotificationsAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: fanzhuyifan, kde
Priority: NOR    
Version First Reported In: 5.27.10   
Target Milestone: 1.0   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description pallaswept 2024-02-12 00:45:51 UTC
SUMMARY

Popup hide setting does not honour browsers' `requireInteraction: true` property on desktop notifications. 

Additionally, if the web app intends to close the notification by itself, after a timeframe longer than KDE plasma's 'hide after' setting, It is not given such an opportunity.

I imagine the second issue cannot be resolved - as it not known whether the app intends to do so, Plasma would have to leave the notification open indefinitely, in order to give the app the chance to close it, so... That is not something I expect could be resolved (although, maybe it could be, and if you're very clever, please feel free! :) Perhaps by using the browser integration, the javascript could be parsed for a call to close() on the notification object? Seems very difficult.)

The first issue however, should be resolvable, since it is known at the time of creation of the notification that it is intended to stay there until interaction occurs.

STEPS TO REPRODUCE
1. Use this site to demonstrate: https://googlechrome.github.io/samples/notifications/requireInteraction.html 
2. Click the "show notifications" button.
3. Observe two desktop notifications, one which should automatically disappear within Plasma's set timeframe, one which should remain visible until it is cleared by the user.

OBSERVED RESULT
See both notifications be hidden, without interaction

EXPECTED RESULT
One should be hidden after the set timeout, the other should require user interaction to hide.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: OpenSUSE Tumbleweed
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.114.0
Qt Version: 5.15.12

ADDITIONAL INFORMATION
Comment 1 fanzhuyifan 2024-02-12 02:28:50 UTC
On plasma 6, this works as expected when using the firefox browser -- the requireInteraction: true notification does not automatically close. What browser are you using?
Comment 2 fanzhuyifan 2024-02-12 02:31:17 UTC
I tested using google chrome on plasma 6 and this still works -- the requireInteraction: true notification does not automatically close. So I believe that has been fixed. Feel free to reopen if you still have this issue on plasma 6!
Comment 3 pallaswept 2024-02-12 03:27:20 UTC
Did you test in Wayland? I was using FF and chrome here, but it's Plasma 5 Wayland, so if it's not fixed in Wayland in Plasma 6 there might still be an issue, but if you tested in Wayland too, yeh I agree, fixed in 6! (hey that rhymes, that should be a slogan or something hahaha)
Comment 4 fanzhuyifan 2024-02-12 03:28:32 UTC
(In reply to pallaswept from comment #3)
> Did you test in Wayland? I was using FF and chrome here, but it's Plasma 5
> Wayland, so if it's not fixed in Wayland in Plasma 6 there might still be an
> issue, but if you tested in Wayland too, yeh I agree, fixed in 6! (hey that
> rhymes, that should be a slogan or something hahaha)

Yes I was testing on wayland.
Comment 5 pallaswept 2024-02-12 03:30:19 UTC
> Yes I was testing on wayland.

Wonderful! Fixed in 6! 

Thanks for looking into it and testing it out so quickly! Enjoy the rest of your week :)