Bug 364798

Summary: Double-click on systray app icon should show the app's main window
Product: [Plasma] plasmashell Reporter: Jiri Slaby <jirislaby>
Component: System Tray widgetAssignee: Martin Klapetek <mklapetek>
Status: CONFIRMED ---    
Severity: wishlist CC: aleixpol, eridanired123, kdelibs-bugs, materka, nate
Priority: NOR    
Version: 5.22.4   
Target Milestone: 1.0   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: icewm click backtrace
KDE5+qt4 click backtrace
KDE5+qt5 click backtrace

Description Jiri Slaby 2016-06-27 08:37:59 UTC
When I double click an icon in systemtray, it does nothing, but it should open the main window of the relevant application. This works without knotifications correctly, e.g. in icewm.

I noticed this problem on KDE 5 with psi+:
https://github.com/psi-plus/psi-plus-snapshots

FWIW middle and right clicks and scroll events are not passed down to the app correctly too. 

For testing purposes, I wrote a minimalistic simple app creating only a QSystemTrayIcon:
https://github.com/jirislaby/collected_sources/tree/master/qt5-icon

When I click on the icon in icewm (i.e. no knotifications), I get:
left button: activate 3
middle button: activate 4
right button: activate 1
double click: activate 3 & activate 2
scroll: wasn't tried

In KDE 5, the app built against qt5 (libQt5Core.so.5 => /usr/lib64/libQt5Core.so.5):
left button: activate 3
middle button: activate 1 (WRONG)
right button: NOTHING (WRONG)
double click: activate 3 & activate 3 (WRONG)
scroll: NOTHING (WRONG)

In KDE 5, the app built against qt4 (libQtCore.so.4 => /usr/lib64/libQtCore.so.4):
left button: activate 3
middle button: activate 4
right button: NOTHING (WRONG)
double click: activate 3 & activate 3 (WRONG)
scroll: eventFilter true 31

Reproducible: Always
Comment 1 Jiri Slaby 2016-06-27 08:40:11 UTC
Created attachment 99714 [details]
icewm click backtrace
Comment 2 Jiri Slaby 2016-06-27 08:42:26 UTC
Created attachment 99715 [details]
KDE5+qt4 click backtrace
Comment 3 Jiri Slaby 2016-06-27 08:43:37 UTC
Created attachment 99716 [details]
KDE5+qt5 click backtrace
Comment 4 Jiri Slaby 2016-06-27 08:49:57 UTC
Versions:
qt4: libqt4-4.8.7-4.1.x86_64
qt5: libQt5Core5-5.6.0-1.1.x86_64
KDE5: plasma-framework-5.22.0-1.1.x86_64
knotifications: libKF5Notifications5-5.22.0-1.2.x86_64
Comment 5 Jiri Slaby 2016-06-27 08:51:53 UTC
And yet, what should the activate numbers actually be:
QPlatformSystemTrayIcon::Context	        1
QPlatformSystemTrayIcon::DoubleClick	2
QPlatformSystemTrayIcon::Trigger	        3
QPlatformSystemTrayIcon::MiddleClick	4

according to:
http://doc.qt.io/qt-5/qplatformsystemtrayicon.html#ActivationReason-enum
Comment 6 Jiri Slaby 2016-06-27 09:39:34 UTC
And indeed, removing /usr/lib64/libKF5Notifications.so.5* makes the problem disappear.
Comment 7 Aleix Pol 2017-02-09 17:25:53 UTC
So it was a binary compatibility issue?
Comment 8 Jiri Slaby 2017-02-10 08:55:18 UTC
(In reply to Aleix Pol from comment #7)
> So it was a binary compatibility issue?

Not at all -- it only means that libKF5Notifications5 is the culprit.

Now, even when the KDE/plasma stack in opensuse completely runs on the top of qt5, the problem still persists.