element-hq / element-hq/element-web
Linux/KDE: Keep Element's system tray icon available until the application is explicitly exited
- Dominant language
- TypeScript
- Stars
- 13.5k
- Forks
- 2.8k
- PR merge metrics
- PR metrics pending
Description
### Your use case
#### What would you like to do?
I would like Element Desktop on Linux/KDE to keep its system tray icon permanently available for the entire lifetime of the application.
The tray icon should be created when Element starts and remain present even after the main window is closed or minimized.
The icon should only disappear when the user explicitly chooses **"Quit" / "Exit Element"** and the application actually terminates.
#### Why would you like to do it?
Currently, on KDE Plasma, the Element tray icon does not always appear immediately when Element is launched.
Sometimes it takes a long time before the icon appears after closing or minimizing the main window, and sometimes the tray icon **does not appear at all**.
When the icon is inside KDE's hidden/overflow system tray area, there can also be a noticeable delay before the Element icon becomes available.
There is also a noticeable delay when clicking the Element tray icon to reopen or restore the main Element window. The application can take a significant amount of time to respond and display the window.
These delays make the tray integration feel unreliable and make it difficult to tell whether Element is actually running correctly in the background.
For a messaging application, I would expect Element to remain available in the background and keep its tray icon while the application is running, with the tray icon responding immediately when clicked.
#### How would you like to achieve it?
I suggest creating the system tray icon once when Element starts and keeping the same tray item alive for the entire lifetime of the Element process.
Closing or minimizing the main window should only hide the window. It should **not destroy or recreate the tray icon**.
Clicking the tray icon should immediately restore/focus the existing Element window rather than causing the application to reinitialize the tray integration or take a long time to respond.
The desired behavior would be:
**Start Element → tray icon appears immediately → close the main window → Element continues running in the background → tray icon remains available → click the tray icon → Element window immediately reappears → tray icon remains available → only "Quit/Exit Element" removes the tray icon and terminates the application.**
This would avoid both the delayed appearance of the tray icon and the delay when using the tray icon to reopen Element.
### Have you considered any alternatives?
I have considered simply restarting Element when the tray icon does not appear or when the tray becomes unresponsive, but this is not a good workaround for a background messaging application.
I think keeping one persistent tray icon for the entire lifetime of the application, while keeping the existing application process and window readily accessible, would provide a much more reliable experience on Linux/KDE.
### Additional context
Tested on:
* OS: Arch Linux (rolling)
* Desktop Environment: KDE Plasma 6.7.5
* Display server: Wayland
* Installation method: Flatpak
* Element version: 1.12.28
* Kernel: 7.2.6-arch2-1
Contributor guide
Research direction
No files, tests, or entry points are named. Start by locating the Linux/KDE tray integration and the handlers for window close, tray activation, and explicit Quit; verify how tray lifetime currently follows the window. Done means the tray icon appears at startup, survives window close or minimization, restores the existing window promptly, and disappears only when Element exits.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, typescript
- Domain
- desktop, operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100