Bug 437988 - KSNI to indicate when it couldn't register anything
Summary: KSNI to indicate when it couldn't register anything
Status: REPORTED
Alias: None
Product: frameworks-knotifications
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-02 11:43 UTC by Harald Sitter
Modified: 2021-06-08 22:29 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Sitter 2021-06-02 11:43:23 UTC
KSNI can skip registering an indicator

            // prevent infinite recursion if the KDE platform plugin is loaded
            // but SNI is not available; see bug 350785
            qCWarning(LOG_KNOTIFICATIONS) << "env says KDE is running but SNI unavailable -- check "
                                             "KDE_FULL_SESSION and XDG_CURRENT_DESKTOP";

this ought to be communicated to the outside world one way or another through API. currently an application must assume the SNI is registered, but that can easily not be the case when one of the pieces of the SNI infrastructure are broken. the application then may want to either very visually tell the user or otherwise handle the situation. otherwise the application may seem broken when indeed it's something behind the scenes

e.g. an app that has an option 'show tray icon' will not work correctly when kded fails to start and consequently org.kde.StatusNotifierWatcher is missing

another example is drkonqi which relies on tray icons as primary visualization mode. when the tray icons can't be registered or visualized that is important information to drkonqi as it has to do fallback visualization.

specifically it might make sense to pick up drkonqi's code and monitor both kded and plasmashell to figure out if the SNI can actually be visualized and that expose that through generic enum State{Unknown,NotRegistered,NotVisualized,Working,WorkingLegacy} API that tracks the effective representation of the SNI. another less comprehensive option would be to simply add a "failed to register" signal that is emitted when the warning is printed