Summary: | Interoperability with libayatana-appindicator | ||
---|---|---|---|
Product: | [Plasma] plasmashell | Reporter: | Jorg K <mozilla> |
Component: | System Tray widget | Assignee: | Plasma Bugs List <plasma-bugs> |
Status: | RESOLVED NOT A BUG | ||
Severity: | normal | CC: | materka, qydwhotmail |
Priority: | NOR | ||
Version: | 5.18.0 | ||
Target Milestone: | 1.0 | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Jorg K
2023-01-14 11:14:25 UTC
Similar bug: Bug 371576. Better test program: https://github.com/Betterbird/thunderbird-patches/issues/20#issuecomment-1382735683 ayatana says "Based on KSNI it also works in KDE and will fallback to generic Systray support if none of those are available.", ayatana will emit NewTitle signal when a new title is set: https://github.com/AyatanaIndicators/libayatana-appindicator/blob/59e472a3caf62f7760f2568729fec8dbc25f8a18/src/app-indicator.c#L978 , and Plasma system tray will also update the title after the signal is received. Not sure it's whose fault. NewIcon is also emitted: https://github.com/AyatanaIndicators/libayatana-appindicator/blob/59e472a3caf62f7760f2568729fec8dbc25f8a18/src/app-indicator.c#L2032 , and there is no IconPixmap in ayatana. Plasma system tray will try to read the string in "IconName" first, if it's null, the data in "IconPixmap" will be read ( https://invent.kde.org/plasma/plasma-workspace/-/blob/e365c363a7a8e9650798350044d6d348092b3606/applets/systemtray/statusnotifieritemsource.cpp#L311 ). It seems ayatana only supports absolute path, and icon name is not supported. I see no problem so far as the test program also uses absolute paths. I tend to believe the bug is in ayatana or elsewhere since I use fcitx5, it also uses KSNI and the icon in Plasma system tray can be updated normally. Thanks for the comment. There is a bit of discussion going on at https://github.com/Betterbird/thunderbird-patches/issues/20#issuecomment-1382814462 and further down with some test results for https://github.com/Betterbird/thunderbird-patches/files/10417402/appindicator-dynamic-test.zip https://github.com/Betterbird/thunderbird-patches/files/10417451/appindicator-dynamic-test-with-tooltip.zip Would you be able to run those test programs? (In reply to Jorg K from comment #4) > Thanks for the comment. There is a bit of discussion going on at > https://github.com/Betterbird/thunderbird-patches/issues/20#issuecomment- > 1382814462 > and further down with some test results for > https://github.com/Betterbird/thunderbird-patches/files/10417402/ > appindicator-dynamic-test.zip > https://github.com/Betterbird/thunderbird-patches/files/10417451/ > appindicator-dynamic-test-with-tooltip.zip > > Would you be able to run those test programs? Run with `kdesu ./betterbird-systray-icon`, title and icon are changed as expected. Without root, there is no icon in the system tray. > Run with `kdesu ./betterbird-systray-icon`, title and icon are changed as expected. Without root, there is no icon in the system tray. OK, thanks. So KDE shows the title "Test Icon Title x", not the specially added tooltip. Well, OK. One user/tester reported in https://github.com/Betterbird/thunderbird-patches/issues/20#issuecomment-1382303629 that the "number" (in the title) didn't update. Apparently a false report. So problem b) from comment #0 "KDE doesn't appear to update the text" is a non issue. Good to know. How about the root requirement? What needs to change to get this going without root? And another question: Is it true that the icon needs to reside in a folder called "icons". In the more recent test programs we made it so, but Betterbird has a different directory structure. This can be tested with an earlier test program https://github.com/Betterbird/thunderbird-patches/files/7781835/betterbird-systray-icon-2.zip. Executable needs to be started in the folder and icon is expected to reside in the same folder, not a subfolder. The problem is self->priv->connection is always null when not running as root, so check_connect can't actually register an system tray item. Not sure if the test program uses an too old version of ayatana. At least this commit is not included. https://github.com/AyatanaIndicators/libayatana-appindicator/commit/e7acaf90ba791655ce26508c1f5facdea855d2aa I ran the new test program and commented out `if (priv->menu == NULL) return;` in check_connect, and now the icon shows as expected. Thanks for the comment, now you're debugging ayatana ;-) We've pulled their latest stuff from https://github.com/AyatanaIndicators/libayatana-appindicator This commit https://github.com/AyatanaIndicators/libayatana-appindicator/commit/e7acaf90ba791655ce26508c1f5facdea855d2aa appears to be included, take for example the very first change: -struct _AppIndicatorPrivate { +typedef struct { https://github.com/AyatanaIndicators/libayatana-appindicator/blob/f225dccbd82f48bb1ab10767b9b074e24fedb0f3/src/app-indicator.c#L71 or in our code: https://github.com/Betterbird/thunderbird-patches/blob/e8b944d0292ac5b473af4cfb7a3378922194513d/102/features/12-feature-linux-systray.patch#L343 (In reply to Fushan Wen from comment #9) > I ran the new test program and commented out `if (priv->menu == NULL) > return;` in check_connect, and now the icon shows as expected. That works. Only question left is the icon location. In some earlier test programs we didn't have it in an "icons" sub-directory and it still showed. I guess, https://bugs.kde.org/show_bug.cgi?id=371576#c0 "KDE 5.8 now demands custom icon folders have their names ended in 'icons'." isn't correct (any more?). I think we can close the bug. Thanks a million for your help. |