Bug 365308 - Left clicking on some system tray icons results in no action
Summary: Left clicking on some system tray icons results in no action
Status: RESOLVED DOWNSTREAM
Alias: None
Product: plasmashell
Classification: Plasma
Component: System Tray (show other bugs)
Version: 5.9.3
Platform: Neon Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
: 350944 397366 404208 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-07-10 01:41 UTC by Jared Sutton
Modified: 2020-01-16 12:51 UTC (History)
13 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
xembedsniproxy vs normal (13.63 KB, image/png)
2017-05-30 03:14 UTC, Jared Sutton
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jared Sutton 2016-07-10 01:41:06 UTC
Left-clicking certain icons in the system tray which are displayed by some applications (e.g., Google's Hangouts extension for Chrome, Slack's desktop application) seems to perform no visible action.  Performing the same action with the same applications on other desktop environments (e.g., XFCE) opens the associated application's main window.

Reproducible: Always

Steps to Reproduce:
1. Start an application which displays an icon in the system tray (e.g., Slack for Linux)
2. Close the application's main window.
3. Try to raise the application's main window by left-clicking on the application's icon in the system tray.

Actual Results:  
The application's main window does not appear.

Expected Results:  
The application's main window show appear.

As indicated in the description, I have only noticed this behavior with certain applications.  I have not seen any issues with Plasma's built-in items in the tray.  I believe I first noticed this issue after Xembed system tray icons was restored to Plasma 5 (after having been previously removed from Plasma 5 in June 2014).  I had been hoping that the re-written tray component in Plasma 5.7.0 would resolve this issue.
Comment 1 Jared Sutton 2016-07-10 02:01:35 UTC
It's worth noting that I back-ported the Plasma 5.7.0 packages from Raw Hide to test this on my Fedora 24 system.  But as noted above, this issue has been present for at least the last year.
Comment 2 Marco Martin 2016-08-16 12:16:58 UTC
may be an xembed sni proxy issue?
Comment 3 Jared Sutton 2016-10-05 14:05:12 UTC
As an update here, the issue is still present in Plasma 5.8.0.  I'm testing this release on Ubuntu 16.04 and installed Plasma from the KDE Neon repository.

In addition to the applications mentioned in the original report, the Syncthing-GTK application is affected also.  I have found at least one non-KDE application which is *unaffected* by this bug: Scudcloud (an open-source Slack client).

@Marco Martin: Do you know of a way to verify whether or not this issue is sni proxy related?
Comment 4 David Edmundson 2016-10-05 14:48:14 UTC
Easy test:

if you run killall xembedsniproxy and the icon goes away then it's related.

If the icon remains, then it's not talking natively.
Comment 5 Jared Sutton 2016-10-05 14:59:27 UTC
Thanks David.  I killed xembedsniproxy and the icons remained, so it appear that none of my tested applications are using it.  So that indicates that these applications are all creating SNI/AppIndicator native tray icons?
Comment 6 Jared Sutton 2016-11-08 15:45:23 UTC
Confirmed that this is still an issue with Plasma 5.8.3 on Neon.
Comment 7 Nikolaos Kakouros 2017-02-10 10:50:46 UTC
I cannot reproduce this with Slack 2.4.2 and Hangouts for Chrome latest from webstore. Running on arch linux with plasma 5.9.1.
Comment 8 Adam Treat 2017-03-04 03:36:27 UTC
I can reproduce this with latest KDE neon package of KDE Plasma Desktop 5.9.3.

Install latest tomboy application and minimize to the systray and left click and no action occurs.

KDE Plasma Desktop - 4:5.9.3-0neon+16.04+build55
Tomboy - 1.15.4-0ubuntu3
Comment 9 Adam Treat 2017-03-04 03:42:26 UTC
Just tried with 'Hangouts for Chrome' on KDE neon with plasma 5.9.3 as above and can reproduce as well.

That leads me to believe this is a distro/packaging problem since Arch doesn't exhibit the issue, but KDE neon does.
Comment 10 David Edmundson 2017-03-04 23:47:43 UTC
>Do you know of a way to verify whether or not this issue is sni proxy related?

Super simple test.

run killall xembedsniproxy.

If the icon disappears, then it was being handled by xembedsniproxy. If the icon remains it was using SNI all along.

As for the comments about Vhromium, they do use both depending on distro setup.



 Please reopen this bug, when we know what this bug is supposedly actually against.
Comment 11 Adam Treat 2017-03-06 16:19:25 UTC
It is definitely using SNI. Killing xembedsniproxy has no effect.
Comment 12 Jared Sutton 2017-03-06 16:51:09 UTC
David,

I confirmed in Comment 5 that I had performed the test that you mentioned.  All of my test apps are SNI-based.  Adam has also confirmed the same.  Is there anything else we can do to provide more information to move forward?

Thanks,
Jared
Comment 13 David Edmundson 2017-03-06 16:59:20 UTC
It's a stupid application bug. Unity does something weird for left click, so a lot of apps don't bother implementing the raise functionality.

A workaround was put in for 5.10.  Though that still requires applications to make sure they don't pretend to implement Activate.

You can test by using qdbusviewer to find the application and call Activate manually and see what happens.

*** This bug has been marked as a duplicate of bug 375351 ***
Comment 14 Roman Gilg 2017-04-01 18:39:46 UTC
I reopen this bug report. I proposed a workaround for 5.10 as David mentioned, but that one was reverted again already back on master branch, because something else broke. :X

Some facts:
* The problematic apps using libappindicator, an Ubuntu/Unity library, which doesn't really support left-click-to-open-window, because Unity only opens the context menu on left click.
* I made a patch https://phabricator.kde.org/D4301, which would at least open the context menu on left click (since I thought, there is no sane way to open the window without libappindicator exporting that, but since apparently XFCE supports it, we should think this over again).
* Currently it's back to doing-nothing-on-left-click because of the revert https://cgit.kde.org/plasma-workspace.git/commit/?id=27b1030756002e91b60ba51483efe9c2c477d16e, which states that xembedsniproxy were broken because of my change.
* So how should we move forward? Is there a way to open and raise the window without using libappindicator? For example could we use KWindowSystem in some way?
Comment 15 Roman Gilg 2017-04-01 19:15:22 UTC
Ok, looking again at the revert https://cgit.kde.org/plasma-workspace.git/commit/?id=27b1030756002e91b60ba51483efe9c2c477d16e it's a revert for something else and therefore it's a regression on my commit.

I've already fixed that in https://phabricator.kde.org/D5270, but we could still try to find a better solution to do a real "left click raises window instead of only context menu", like it's in XFCE.
Comment 16 Michail Vourlakos 2017-04-02 09:11:24 UTC
*** Bug 378337 has been marked as a duplicate of this bug. ***
Comment 17 Jared Sutton 2017-05-30 03:14:43 UTC
Created attachment 105768 [details]
xembedsniproxy vs normal

Interesting thing I found on this topic: Chromium and Slack (which I believe is a Chromium-based app) both support xembed- and appindicator-style tray icons, depending on whether or not they find libappindicator installed.  See attached image for a comparison of the icons created (xembed on top, appindicator on bottom.

+---------------------------------------+
|              |   Broken   | Distorted |
|              | Left Click |   Image   |
+---------------------------------------+
| appindicator |     XX     |           |
|   Chromium   |     XX     |           |
+---------------------------------------+
| appindicator |     XX     |     XX    |
|    Slack     |     XX     |     XX    |
+---------------------------------------+
|   xembed     |            |     XX    |
|  Chromium    |            |     XX    |
+---------------------------------------+
|   xembed     |            |           |
|   Slack      |            |           |
+---------------------------------------+

In my original bug report, I noted that XFCE seems to hangle things correctly.  I believe that's because it *only* supports xembed-style tray icons.
Comment 18 Alexander Mentyu 2018-02-26 13:50:01 UTC
Left clicking to rise/hide app window works for:
scudcloud 2:1.64-2
syncthing-gtk 1:0.9.3-1

and not working for:
Google Hangouts (both Hangouts and Chromium background tray icons)
slack-desktop 3.0.5-1
skypeforlinux-stable-bin 8.16.0.4-1

Plasma: 5.12.2
Apps: 17.12.2
Frameworks: 5.43.0
Qt: 5.10.1
Kernel: 4.14.20-2-MANJARO
OS: Netrunner Rolling
Comment 19 Christoph Feck 2018-09-05 03:39:39 UTC
*** Bug 397366 has been marked as a duplicate of this bug. ***
Comment 20 Nick Stefanov 2018-09-05 08:30:38 UTC
This problem has been solved for a while and it come again in a couple of months. This is a problem since a few versions ago and is very uncomfortable. For example if I want to open Skype, I have to right click on the Skype icon and select Open Skype. Left click just does nothing - single or double click. The same applies to applications like Discord, Viber, etc. I tried to open this apps with left click on Cinnamon, LXDE, Xfce and there isn't such problem at all. It's definitely a Plasma problem.
Comment 21 Nick Stefanov 2018-10-12 12:37:11 UTC
Is there any hope this will be fixed any time soon? It's a big problem and is very inconvenient. Some icons are not properly rendered too. For example MS Teams's icon is just a purple square and one doesn't know when and if some one is writing or calling him. All these simple things work in other DE's without problems.
Comment 22 Nick Stefanov 2018-10-12 18:28:45 UTC
I need some help. I made a little profress with this. It seems this problem occures only in Arch linux for me. I tried Manjaro KDE and MS Teams and Skype behaves as they should. I already tried to figure out where is the reason for this but I can't find it. Plese tell me what package I have to install, setting to change or config file or something. It's really important for me so please help me. Thank you in advance!
Comment 23 Patrick Silva 2018-10-13 15:14:35 UTC
I have just tested the following apps on Arch Linux, plasma 5.14:
slack (from flathub/flatpak)
skype (from flathub/flatpak)
discord (from flathub/flatpak)
m$ teams for linux (from AUR)
tomboy notes (Arch repositories)

Only skype shows up when its icon in the system tray is left-clicked, also
its icon in the system tray disappears when I run "killall xembedsniproxy".
When I left-click on the other software's icons, nothing happens (m$ teams) or the context menu opens (discord, slack, tomboy). Tomboy also disappears from the system tray when I kill xembedsniproxy.
Comment 24 Nick Stefanov 2018-10-13 15:57:54 UTC
I tried clean installation of Arch and all is working fine. It's mine installation borked but I can't figure it out where is the culprit. I deleted the panel and created a new one, changed the icons and theme to default, tried a new clean profile, changed compositor settings to default, changed desktop effects to default to no avail. I even ended with coping my whole home folder, setup a new Arch KDE installation and copied my home folder back - all icons in the system tray works as they should, hence it's obvious that the problem isn't in the home folder. 

For me with the new instalation MS Teams's icon is clickable and the app is rising with only one left click. On my current installation nor Discord, nor Skype, nor MS Teams icon's are left clickable and in addition the MS Teams icon is one big purple square, not an icon.

Plese somebody tell me which file is responsible for this in order to substitute it from a clean installation. My current installation is heavy modified and a new install will take me at least one month qwirking so that's no option for me. Devs, please help, I know that's not a KDE problem but only you have the knowledge to help me. Thank you in advance!
Comment 25 Nick Stefanov 2018-10-14 15:11:49 UTC
I found it!!! It takes me 30 hours! For me the culprit is indicator-powersave:

https://www.kaminata.net/forum/viewtopic.php?t=118029

It depends on some packages which broke Plasma's panel even when it isn't started. Remove it, remove the dependencies with yaourt --noconfirm -Rns $(yaourt -Qdttq); yes | yaourt -Scc, restart and all is working perfect!
Comment 26 Konrad Materka 2019-10-18 15:43:50 UTC
There are basically two types of System Tray protocols:
* Legacy X11 XEmbed protocol (obsolete)
* SNI/AppIndicator DBus protocol (preferred)

First one is very old but supported by most libraries and Desktop Environments (DE). In KDE it is handled by xembedsniproxy process, so if you kill it icons will disappear. XFCE and some other DEs are supporting only this protocol. It won't work on Wayland.
Legacy icon is fully controlled by application (in most cases) and usually has left click implemented.

Second one is a modern replacement for XEmbed. It is display server agnostic, so it work on X and Wayland. DE is responsible to implement DBus service which watches for new "Status Notifiers". Most modern frameworks are using this protocol, if it is available.
You can list currently registered icons by running:
> qdbus org.kde.StatusNotifierWatcher /StatusNotifierWatcher RegisteredStatusNotifierItems
Unfortunately when SNI/AppIndicator is used most apps do not have "Activate" (left click) action implemented, there is only "ContextMenu" (right click). You can check if application implements "Active" method using qdbusviewer app. Select something like ":1:42" (based on the out from dbus command above). Check:
"StatusNotifierItem/" -> "org.kde.StatusNotifierItem" -> "Method: Active"
If there is only "Method: ContextMenu", KDE can't do anything with that. It is the application fault and you can report a bug to the developers of that application.
Comment 27 Konrad Materka 2019-10-18 15:46:26 UTC
*** Bug 404208 has been marked as a duplicate of this bug. ***
Comment 28 Nate Graham 2020-01-15 20:15:39 UTC
Konrad, is there nothing we can do here? If not, we should close the bug as RESOLVED DOWNSTREAM.
Comment 29 Nate Graham 2020-01-15 20:18:52 UTC
*** Bug 350944 has been marked as a duplicate of this bug. ***
Comment 30 Konrad Materka 2020-01-16 12:51:25 UTC
There is nothing we can do about it, this is how these applications behave. Most of these apps does nothing on left click, in such cases KDE sends right click, so at least user gets a menu.

Some applications are created correctly, for example:
Clementine:
https://github.com/clementine-player/Clementine/blob/1.3.1/src/ui/qtsystemtrayicon.cpp#L133
Strawberry Music Player
https://github.com/jonaski/strawberry/blob/0.6.8/src/core/qtsystemtrayicon.cpp#L161