desktop icon indicating copy to clipboard operation
desktop copied to clipboard

Left mouse click on tray icon on Linux shows context menu instead of showing the window

Open dantalian-pv opened this issue 5 years ago • 14 comments

I confirm (by marking "x" in the [ ] below: [x]):


Summary In Mattermost Desktop 4.1.2 and previous versions left mouse click on the tray icon showed a main window, and starting from version 4.2.0 left and right mouse clicks have the same behavior and shows context menu, which is inconvenient in case I have to make two clicks now instead of one to open the window. Furthermore, when I had a message and clicked on the tray icon, it showed the main window and opened a dialog with a new message.

Environment

  • Operating System: Linux (4.12.14-lp150.12.48-default x64) openSUSE Leap 15.1 with KDE 5.12.5
  • Mattermost Desktop App version: 4.2.0
  • Mattermost Server version: 5.8.0

Steps to reproduce

  1. Run application with "Show icon in the notification area" and "Leave app running in notification area when application window is closed" setting on KDE.
  2. Close a main window
  3. Left mouse click on the tray icon.

Expected behavior Left mouse click on tray icon should show the main windows with opened dialog where new massage is arrived.

Observed behavior Left mouse click shows context menu as well as right mouse click on the tray icon.

dantalian-pv avatar Mar 18 '19 12:03 dantalian-pv

Ticket for tracking: https://mattermost.atlassian.net/browse/MM-14674

amyblais avatar Mar 20 '19 16:03 amyblais

I experience it too and think it odd, that user have to complain about such a bug, instead of fixing it right away. Basically any application providing a systray entry works the way expected by the OP -- why won't mm?

2019-05-10 avatar Oct 17 '19 09:10 2019-05-10

This seems to be due to a limitation of electron between versions 3 and 8. The click event is not handled on Linux for these versions.

I opened a PR for the same problem for Rambox here. In their case, the fix consists in simply bumping the electron version to 8 and properly handling the click event.

Please consider doing the same when you will reach that version of electron 😊

marcoesposito1988 avatar Apr 05 '20 09:04 marcoesposito1988

This is working correctly for me on Kubuntu 20.04 using KDE Plasma and Desktop App v5.0.2. Closing unless this issue is still relevant.

devinbinnie avatar Dec 09 '21 19:12 devinbinnie

Debian/Sid, MM Desktop 5.0.2 and the original issue still persists. Please reopen.

2019-05-10 avatar Dec 10 '21 08:12 2019-05-10

Same here on Kubuntu 20.04 with Plasma (fully up to date as of today, Dec. 10th) and 5.0.2. The issue still persists. Already deleted ~/.config/Mattermost.

marcoesposito1988 avatar Dec 10 '21 08:12 marcoesposito1988

@2019-05-10 @marcoesposito1988 How did you install Mattermost on your machines? I used the .deb and had no trouble.

devinbinnie avatar Dec 10 '21 14:12 devinbinnie

Thanks for reopening the issue @devinbinnie! I also used the deb. I already tried deleting the config, but if I can try something else (deleting some cache) or you need some logs or more information about my system, just please let me know.

In the weekend I may manage to test it in a fresh VM with a live Kubuntu

marcoesposito1988 avatar Dec 10 '21 14:12 marcoesposito1988

@marcoesposito1988 That's what I used, a fresh Kubuntu VM and it works fine for me. Let me know what your findings are :)

devinbinnie avatar Dec 10 '21 14:12 devinbinnie

The issue doesn't appear indeed in a fresh instance. I will try to find the root cause of the issue.

marcoesposito1988 avatar Dec 12 '21 23:12 marcoesposito1988

Why has this been closed? Unless the issue is solved for existing installations, it certainly cannot be considered solved. The MS Windows way ("reinstall everything") is definitely not a solution.

2019-05-10 avatar Feb 02 '22 08:02 2019-05-10

Why has this been closed? Unless the issue is solved for existing installations, it certainly cannot be considered solved. The MS Windows way ("reinstall everything") is definitely not a solution.

This issue is not closed, we are awaiting investigation. @marcoesposito1988 Did you ever end up finding anything with your investigation?

devinbinnie avatar Feb 02 '22 15:02 devinbinnie

Uh, I apologize. I got confused by the "Closed" label on the reference to #1937

2019-05-10 avatar Feb 03 '22 11:02 2019-05-10

Found another case for this problem.

If you close main window before actually configuring any server, then there's no way you can bring main window back again.

Steps to reproduce

from master branch

  1. clean all settings
  2. npm ci
  3. npm run watch
  4. don't configure servers
  5. go to settings
  6. enable Show icon in the notification area
  7. enable Leave app running in notification area when application window is closed
  8. close window without terminating app

Result

In tray there are no options to bring main window back again.

Workaround

  1. make app restart

AKorezin avatar May 27 '22 14:05 AKorezin

I did not have this issue until I installed the libappindicator-gtk3 package from the Arch Linux repositories. After installing this, clicking on the system tray did not even register in the mattermost-desktop log in any way. Uninstalling it again fixed the problem.

EDIT: This problem was identified a long time ago, but never really fixed. Maybe one can opt-out of using the appindicator in all/most cases?

EDIT2: Did not read till the end, should be fixed in newer versions of electron: https://github.com/electron/electron/pull/36333

kevfocke avatar Jan 20 '23 09:01 kevfocke

This has been fixed in this PR: https://github.com/mattermost/desktop/pull/2708 (actually probably earlier since it's an Electron issue).

Note for users still using libappindicator, this is not fixed and sounds like it won't be fixed upstream. But it should be working for most users.

Closing.

devinbinnie avatar May 04 '23 17:05 devinbinnie