Bug 452732

Summary: In Status and Notifications panel, Notifications icon sometimes does nothing
Product: [Plasma] plasmashell Reporter: luca <luca.pedrielli>
Component: NotificationsAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: bugs.kde.org.facelift226, dashonwwIII, erfan.qeui, kde, nate, postix
Priority: NOR    
Version First Reported In: 5.24.4   
Target Milestone: 1.0   
Platform: Debian testing   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=452627
Latest Commit: Version Fixed/Implemented In: 6.2.0
Sentry Crash Report:
Attachments: notifications icon unresponsive
example

Description luca 2022-04-18 13:38:47 UTC
Created attachment 148222 [details]
notifications icon unresponsive

In systemtray -> Status and Notifications -> Notifications icon sometimes, when I click with the mouse, does nothing while it should open the Notifications panel. 

I'm sorry, but I have not found when it happens :( while it works with a keyboard shortcut.

KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2
Comment 1 Nate Graham 2022-04-18 15:14:22 UTC
When this happens, do other icons do something when clicked?

Can you run Plasma in a terminal window with `plasmashell --replace` and see if there is any terminal output when you click on it and nothing happens?
Comment 2 luca 2022-04-18 16:05:33 UTC
- everything works except notifications

- no output in terminal when I click on the icon as I'm clicking not on the icon 

I've found a way to reproduced it:
I send me an email, waiting for notifications bell in systray, click on it, the bell disappeares and notifications icon become unresponsive
Comment 3 luca 2022-04-18 16:12:56 UTC
on new login or after plasmashell --replace it always works ok, it stop working during the session
Comment 4 Nate Graham 2022-04-18 16:13:50 UTC
OK, thanks. Cannot reproduce on Wayland. Are you on X11 or Wayland. If you're on one, can you try in the other?
Comment 5 luca 2022-04-18 17:30:42 UTC
I use x11, but I can reproduce it in wayland too.

I used a simple script like this to send notifications, and activeted history for other applications in systemsettings->Notifications:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#!/usr/bin/env python3
import dbus

notify_interface = dbus.Interface(
    object=dbus.SessionBus().get_object("org.freedesktop.Notifications", "/org/freedesktop/Notifications"),
    dbus_interface="org.freedesktop.Notifications")

notify_interface.Notify("", 0, "", "Hello world", "This is an example notification.", [], {"urgency": 1}, 10000)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Comment 6 luca 2022-04-19 06:54:04 UTC
I found a way to reproduce:
send a notification, click on the bell and open notifications panel, click on the bell and close the panel. Now icon is unresponsive.
while if I send a notification, click on the bell and open notifications panel, click on the desktop and close the panel, the icon is responsive.
Comment 7 Nate Graham 2022-04-19 18:23:57 UTC
Still cannot reproduce with those steps. What a weird bug. :(
Comment 8 luca 2022-04-19 18:42:07 UTC
Created attachment 148255 [details]
example
Comment 9 luca 2022-04-19 18:44:34 UTC
(In reply to Nate Graham from comment #7)
> Still cannot reproduce with those steps. What a weird bug. :(

Yes, it is ;)
Comment 10 luca 2022-04-20 08:10:49 UTC
same behavior in the last kde neon
Comment 11 Kai Uwe Broulik 2022-04-20 08:30:47 UTC
Can reproduce
Comment 12 Kai Uwe Broulik 2022-04-20 08:43:34 UTC
I think 69702475e5ae3fda1a4c4a854100ebb4f65e338b might have uncovered a bug.

Notifications has a weird popup handling where it does onPressed: wasExpanded and then onClicked: expanded = !wasExpanded;

This was/is to avoid some weirdness with continuously triggering the popup or something. However, the systemtray now calls mouseArea.clicked without calling pressed before so the applet gets confused. Unfortunately, there's both a property and function pressed and calling mouseArea.pressed(mouse) ends up calling the property rather than function.
Comment 13 Nate Graham 2024-05-08 16:52:45 UTC
*** Bug 483246 has been marked as a duplicate of this bug. ***
Comment 14 Nate Graham 2024-05-08 16:52:48 UTC
*** Bug 483923 has been marked as a duplicate of this bug. ***
Comment 15 Nate Graham 2024-05-08 16:52:51 UTC
*** Bug 486684 has been marked as a duplicate of this bug. ***
Comment 16 Erfan 2024-05-24 15:15:23 UTC
Hi i have same bug as 452732 that get duplicated. I enable history for low priority notification on settings because i needed. as that bug explain it's happened when the new notification received and you open that from the panel and after close that it's hide in hidden icon. if try to open that from hidden icon box it wont open until a new notify receive
Comment 17 Erfan 2024-05-24 15:16:56 UTC
sorry i mean this bug
https://bugs.kde.org/show_bug.cgi?id=483246
Comment 18 ratijas 2024-05-29 12:49:50 UTC
> Notifications has a weird popup handling where it does onPressed: wasExpanded and then onClicked: expanded = !wasExpanded;

It's not weird, it is an idiom in Plasma applets which prevents them from always reopening on click if they are placed in a containment which closes them on press, such as the Desktop surface.

The findings about MouseArea's property and signal name clash are valid. I wonder if it's possible to find a workaround in Qt 6, or even re-implement without such hacks. Not exactly specific to system tray, more of a QtQuick bug/misdesign.
Comment 19 Synthetic451 2024-12-17 04:16:39 UTC
Not sure what changed, but I can't seem to reproduce this anymore in Plasma 6.2.4. I can now always re-open the notifications pane, even when it is hidden in the dropdown arrow on the task tray.
Comment 20 Nate Graham 2024-12-17 15:29:48 UTC
Yeah, there were a lot of changes and fixes here over the past year or so. Thanks for following up!