Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Separate Status Notifier Watcher from LXQt Panel's statusnotifier plugin #2392

Open
marcusbritanicus opened this issue Mar 11, 2023 · 5 comments

Comments

@marcusbritanicus
Copy link

A discussion with @stefonarch about startup delay led to this feature request.

Much of the background is covered in LXQt Session #460

I know that the issue is currently resolved, but I would like to make a suggestion. If I understand the problem correctly, LXQt Session introduces an artificial delay of ~60s to ensure system tray becomes available to apps that need it. This is necessary since the panel is a heavy software, and may take longer to start compared to lighter apps like featherpad.

Currently accepted solution is to arbitrarily wait for N seconds (N = 15? before starting tray apps.

Instead of these complicated solutions, I would like to suggest a far simpler solution. Split the Status Notifier Watcher (code that implements org.kde.StatusNotifierWatcher) and make it a simple daemon. After all, isSystemTrayAvailable() checks if that service is running and a host is registered.

If we split the code that implements this service in a separate daemon, it would start very fast and much of the wait time would be reduced. Additionally, I gather that if the panel crashes (unlikely, but possible), all processes that are tray-icon-only will be killed and will not restart when the panel is restarted. Such a situation would be avoided.

I am suggesting this solution based on my work on DesQ, and this is the solution I adopted. I am willing to make a PR if this solution is acceptable and doesn't have any major drawbacks.

Cc: @stefonarch @palinek @tsujan

@stefonarch
Copy link
Member

I gather that if the panel crashes (unlikely, but possible), all processes that are tray-icon-only will be killed and will not restart when the panel is restarted. Such a situation would be avoided.

This doesn't happen . Panel can be stopped and restarted without consequences for tray apps.

@tsujan
Copy link
Member

tsujan commented Mar 11, 2023

Tray apps aren't affected by the absence of the tray.

@tsujan
Copy link
Member

tsujan commented Mar 11, 2023

This is necessary since the panel is a heavy software, and may take longer to start compared to lighter apps like featherpad.

The delay isn't only for lxqt-panel — the user may prefer another panel under LXQt (LXQt is modular) — but for any tray, that may be provided by any app/panel.

Actually, in all setups that I've had, lxqt-panel has provided the tray in the shortest possible time (you should try KDE Plasma to see that). I don't think a separate daemon would solve anything.

If there's a problem under Wayland, it should have another cause, which should be found and fixed.

@palinek
Copy link
Contributor

palinek commented Mar 13, 2023

Split the Status Notifier Watcher (code that implements org.kde.StatusNotifierWatcher) and make it a simple daemon.

What would such daemon do?
Would it be GUI-less?

  • no -> Would it copy/re-implement all the necessary lxqt-panel logic to position/show the tray icons, menus, etc.?
  • yes -> How would the tray icons/menus be shown? Would it just be a "bridge" between the client applications and the GUI application (lxqt-panel)? How would these two interact (new API specification?)?

@marcusbritanicus
Copy link
Author

marcusbritanicus commented Mar 13, 2023

This doesn't happen . Panel can be stopped and restarted without consequences for tray apps.

@stefonarch I said that from my experience with lxqt-panel (0.16.1, Debian Stable), used outside lxqt-session with custom window manager I was working on. I am sure this has already been fixed in the latest release, and will take your word for it.

yes -> How would the tray icons/menus be shown? Would it just be a "bridge" between the client applications and the GUI application (lxqt-panel)? How would these two interact (new API specification?)?

@palinek Yes. The daemon I proposed would be a gui-less daemon. It is intended to be a bridge between client applications and the GUI - lxqt-panel or any other lxqt-based GUI that may be developed eventually.

Currently, you use the following code:

connect(mWatcher, &StatusNotifierWatcher::StatusNotifierItemRegistered, this, &StatusNotifierWidget::itemAdded);
connect(mWatcher, &StatusNotifierWatcher::StatusNotifierItemUnregistered, this, &StatusNotifierWidget::itemRemoved);

All that needs to be done is switch to the dbus version of the signals:

QDBusConnection::sessionBus().connect(
        WATCHER_SERVICE, WATCHER_OBJECT, WATCHER_PATH, 
        "StatusNotifierItemRegistered", "s", this, SLOT( itemAdded( QString ) ) 
);

Everything else remains the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants