Martchus / syncthingtray

Tray application and Dolphin/Plasma integration for Syncthing
https://martchus.github.io/syncthingtray/
Other
1.77k stars 45 forks source link

Plasmoid bugged in Plasma 6 #239

Open OlegAckbar opened 8 months ago

OlegAckbar commented 8 months ago

Relevant components

Environment and versions

Bug description Plasmoid bugged in Plasma 6. It shows 2 entries in tray settings: one of them has no name and its setting can't be changed, the other one has no icon and its setting doesn't do anything for actual the tray icon of plasmoid (for example I have "always hide" option but plasmoid still stays in tray, see screenshots)

Screenshots Снимок экрана_20240314_233410 Снимок экрана_20240314_233703

Martchus commented 8 months ago

That's strange and something I haven't seen before. Not sure whether I can help here. It looks like some general setup problem. Maybe there's a helpful clue in stdout/stderr of the plasmashell process. You can open a terminal, kill and relaunch plasmashell from there and look for related log messages.

Martchus commented 8 months ago

But also check the README section about configuring the Plasmoid in general. It might help you understand where the tray icon you see actually comes from.

gudvinr commented 8 months ago

I do have the same issue.

That could be caused by old (qt5) plasmoid not being pruned correctly on uninstall.

I see this entries in ~/.config:

.config/plasma-org.kde.plasma.desktop-appletsrc
602:plugin=martchus.syncthingplasmoid
646:extraItems=<...>,martchus.syncthingplasmoid-qt6
647:hiddenItems=<...>,martchus.syncthingplasmoid,<...>,martchus.syncthingplasmoid-qt6

.config/kservicemenurc
49:libsyncthingfileitemaction-qt6=true
77:syncthingfileitemaction=false
Martchus commented 8 months ago

I just had a look on my Tumbleweed system (where I haven't already migrated on a pre-release of KDE 6) and there it looks similar as in your screenshot (but not the same). So even after uninstalling the Qt 5 based version¹ the old entries stays in a disabled way. However, in my case the new entry looks fine (icon is displayed) and behaves like it should. So really only the leftover entry is the problem here.

If that's just a stale entry, allowing to delete it is possibly out of scope here. That's because the code in Plasma's system tray Plasmoid is responsible for managing these entries. However, I couldn't find were this stale entry would be configured so I'm not sure whether it is actually a stale entry. Maybe there's also something wrong with my metadata file causing this entry (in which case it wouldn't be a stale entry but a weird duplicate).


¹ On Arch Linux you could even keep the syncthingtray package installed; its current version no longer contains the Plasmoid anyway.

gudvinr commented 8 months ago

I removed all entries related to both plasmoids from .config/plasma-org.kde.plasma.desktop-appletsrc and .config/kservicemenurc, deleted syncthingtray-qt6 package and restarted system. Now I have proper entry:
image

Now .config/plasma-org.kde.plasma.desktop-appletsrc has these:

620 hiddenItems=<...>,Syncthing Tray (Qt 6)

It's all weird AF. Now it stores name instead of ID (which is very questionable given that multiple applets might have same human-readable title)

OlegAckbar commented 8 months ago

I've deleted .config/plasma-org.kde.plasma.desktop-appletsrc, cleared .config/kservicemenurc, reinstalled syncthingtray-qt6 and restarted PC but the issue still persists

Martchus commented 8 months ago

Both cases are quite weird. I'll try to see how it behaves in my case later.

@OlegAckbar Is the Plasmoid generally working for you (so this is just about the entry like in @gudvinr's case)? And have you tried what I suggested in my first replies?

OlegAckbar commented 8 months ago

@Martchus Yes, plasmoid works just fine, no problem with that. Only I can't hide it in tray. изображение

OlegAckbar commented 8 months ago

@Martchus I've tried launching plasmashell from terminal but I didn't see any weird warnings or errors mentioning syncthingtray (only those mentioning that my locale is not supported).

OlegAckbar commented 8 months ago

systemlog.txt here's journalctl log filtering plasmashell. Maybe you'll find something interesting

OlegAckbar commented 8 months ago

I've built syncthingtray-qt6 on my Arch VM with testing repositories enabled and have exact same issue.

Martchus commented 8 months ago

I also couldn't find anything useful in those logs after a brief look.


I did a few more tests on my system and things are even weirder: First of all I should note that I have multiple screens and thus multiple panels and thus also multiple system tray plasmoids. Plasmoid instances are configured separately and the system tray plasmoid is no exception. So I had two relevant sections in ~/.config/plasma-org.kde.plasma.desktop-appletsrc. I don't think any of the sections (and also not any file in the whole ~/.config and ~/.local/share directories) contained any references to the old plasmoid, though.

So I stopped plasmashell, deleted all keys in the relevant sections of one of the system tray plasmoids and then in fact one Syncthing Tray icon was gone and the other one preserved. When trying to re-configure the gone Syncthing Tray icon via the system tray plasmoid settings I noticed that the weird entry was gone. Only the correct entry was shown and everything worked as expected. Then I opened the settings of the other system tray plasmoid and there was the weird dysfunctional entry again.

So I stopped plasmashell again and then deleted all keys in the relevant sections of all system tray plasmoids. Then all Syncthing Tray icons were gone. When configuring them back everything looked good at first but when opening the plasmoid settings another time the dysfunctional entry was back.

So this is not a stale entry of the old version of the plasmooid. It gets newly created for the current version of the plasmoid under some circumstances which might involve having more than one system tray plasmoid.

I must also note that plasmashell crashed when applying changes of one system tray plasmoid while having the settings window of another one open.

Somehow I think all of this has not much to do with Syncthing Tray but it is a thing of how the official system tray plasmoid handles its settings/entries. So maybe this is worth filing an upstream bug.

gudvinr commented 8 months ago

Nope, apparently it isn't magically fixed and I am having same issue again

Martchus commented 8 months ago

Yes, as I said I could reproduce it. But it is complicated and fixing it probably requires collaboration with Plasma upstream. So far I haven't spent the effort considering I'm not really bothered by this additional invalid entry. (In my tests the real entry always worked so the Plasmoid is fully usable.)

By the way, anyone be welcome to start a discussion with upstream. It doesn't always have to be me asking for help on their channels.

gudvinr commented 8 months ago

I have only one tray applet and only single plasmoid instance, FWIW

LinAGKar commented 7 months ago

I only have one entry in the list:

Screenshot_20240404_113159

and get no syncthing tray icon at all. If I try to add syncthing as a plasmoid it just vanishes again when I restart plasmashell. This being on Tumbleweed.

Martchus commented 7 months ago

If I try to add syncthing as a plasmoid it just vanishes again when I restart plasmashell. This being on Tumbleweed.

So it works as its own Plasmoid and only after restarting disappears again? And re-adding it as its own Plasmoid then makes it work again? Then only the persistency of the Plasma settings would be the problem. The Plasma settings are handled by Plasma so I'm not sure I can do anything about it. Note that I'm also using Tumbleweed but cannot reproduce this issue. Or is that a new issue for you but it worked previously? (I haven't updated my Tumbleweed machine since the 1.5.1 update so I'm still at 1.5.0.)

LinAGKar commented 7 months ago

It doesn't happen to any other plasmoids though, only Syncthing disappears. I'm also still on 1.5.0.

For the tray icon, apparently it does show up if I change the visibility to something else instead of the default "Enabled" (maybe that's a mistranslation). And then the duplicate row also shows up for me, and it won't go into the overflow menu even if I set it to always hidden.

Martchus commented 7 months ago

It doesn't happen to any other plasmoids though, only Syncthing disappears.

Maybe Syncthing Tray is special because it relies on native C++ code. I guess one would have to ask the Plasma developers to review my Plasmoid-specific code for errors because I'm out of ideas at this point and I also cannot reproduce the non-persistency.

For the tray icon, apparently it does show up if I change the visibility to something else instead of the default "Enabled" (maybe that's a mistranslation). And then the duplicate row also shows up for me, and it won't go into the overflow menu even if I set it to always hidden.

Ok, so let's just say that some option in the system tray plasmoid's settings allow you to show the Syncthing Tray Plasmoid within it. And then you run into the same cosmetic issue with the buggy entry like anyone else.


Note that I haven't made any progress on the issue about the buggy entry because it seems to be just cosmetic and also here I'd probably needed help from Plasma developers.

gudvinr commented 7 months ago

Filed an issue in KDE bugtracker:
https://bugs.kde.org/show_bug.cgi?id=485072

stale[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

gudvinr commented 5 months ago

Still the same for me

Martchus commented 5 months ago

Still nothing that I think I can fix from my side. If this is important to you, you'd probably have to dig into the code yourself.

stale[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

LinAGKar commented 3 months ago

I think it's not right to close it while the issue still happens, even if you don't know how to solve it

livexia commented 2 months ago

with plasmoid in plasma 6 after adding it works normal, but after reboot the plasmoid disapper.

Martchus commented 2 months ago

I don't think anyone can help you with so little information. I suggest you have a look at https://github.com/Martchus/syncthingtray?tab=readme-ov-file#configuring-plasmoid and further documentation sections linked from there.

livexia commented 2 months ago
  1. It can be shown as part of the system tray Plasmoid.

With this method somehow syncthing disappears, after I remove syncthing from .config/plasma-org.kde.plasma.desktop-appletsrc and reinstall syncthingplasmoid-qt6. This method works again.

  1. It can be added to a panel or the desktop like any other Plasmoid.

With this method, panel disappear after reboot, but can be added again.

I think this program is great thank you.

Martchus commented 2 months ago

So at least the 1st method works. I have no idea why the 2nd method is not persistent for you. I suppose this has more something to do with the general configuration mechanism of the Plasma shell and less with my specific Plasmoid.

stale[bot] commented 3 weeks ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

olifre commented 3 weeks ago

As a potential extra data point, I can add that I have three Gentoo systems with exactly the same package versions, but different evolution, and two systems show the tray icon while one does not, i.e. two systems behave as the original reporter's system and one as @LinAGKar . It "smells" like this is something fuinny like loading order / iteration order being based on the number of the inode or some other number which can be different in each installation of the very same OS. I could sadly not find an obvious difference between the systems :disappointed: .