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

[BUG] Systray applet's tooltip are not dynamically resfreshed / udpated #320

Closed
Antiz96 opened this issue Oct 1, 2024 · 9 comments
Closed

Comments

@Antiz96
Copy link

Antiz96 commented Oct 1, 2024

Describe the bug

When a systray applet gets its tooltip updated, it won't be updated / refreshed dynamically in nwg-panel until you reload it (e.g. with nwg-panel -sigdwl 1).

To Reproduce

Steps to reproduce the behavior:

  1. Launch any systray applet
  2. Update its tooltip text (see Additional context)
  3. Hover your mouse over the systray icon and see that the tooltip hasn't been updated / refreshed accordingly
  4. Run nwg-panel -sigdwl 1 and see that the tooltip gets updated

Expected behavior

Systray applet's tooltip to be dynamically updated / refreshed (like it does in e.g. xfce4-panel)

Screenshots

I can record a video if it helps, just tell me :)

Desktop (please complete the following information):

  • Linux distribution: Arch Linux
  • Sway version sway version 1.9
  • Panel version nwg-panel version 0.9.39

Additional context

I'm dynamically updating / modifying the tooltip of the systray applet for my arch-update app to include the list of pending updates (for the context, this is done by retrieving the related info from a file thanks to a python 'file watcher' directive, see changes made to the src/lib/tray.py file in Antiz96/arch-update#257). The idea is that users can see the list of pending updates by simply hovering their mouse on the systray icon.

However, it doesn't work in nwg-panel as the tooltip is not automatically refreshed / updated, which forces to reload the panel (e.g. with nwg-panel -sigdwl 1) to get "updated" tooltip. It works in other panels though, like xfce4-panel for instance.

I'm aware that this might be a bit of an unconventional way to use a tooltip but I'm still trying my luck in case this is "fixable" 😄

I remain available if you need any more information!

@nwg-piotr
Copy link
Owner

I'd need to set up some testing environment to deal with this issue. Let me think.

@Antiz96
Copy link
Author

Antiz96 commented Oct 1, 2024

Sure no problem.

If it helps, I can guide you through a way to install & set up Arch-Update to be able to easily generate tooltip changes for its systray in your testing environment as a test case. Let me know if needed :)

@nwg-piotr
Copy link
Owner

It would be not bad. I'd be sure I'm working on the proper issue. :D

@Antiz96
Copy link
Author

Antiz96 commented Oct 1, 2024

1 - Install the arch-update AUR package

2 - Assuming your test env will be using Sway / Nwg-shell: add the arch-update --tray command to your sway config to auto-start the systray at boot (you might eventually need to adding a short sleep beforehand for it to work properly, e.g. sleep 3 && arch-update --tray).
If your test env is using a desktop environment, you can run the arch-update --tray --enable command to add the tray into XDG autostart instead.

3 - Install fastfetch (random pick, will be used to trigger an update for the system and to update the tooltip accordingly): sudo pacman -S fastfetch

4 - Download an earlier version of fastfetch from Arch's archives: curl https://archive.archlinux.org/packages/f/fastfetch/fastfetch-2.25.0-1-x86_64.pkg.tar.zst -O

5 - Downgrade to the earlier version of fastfetch downloaded above: sudo pacman -U fastfetch-2.25.0-1-x86_64.pkg.tar.zst and then right click on the Arch-Update systray icon and click on "Check for updates":

2024-10-01_09-05

This will generate a new update for your system and trigger a tooltip update accordingly, like so:

2024-10-01_01-51

6 - You can then left click the systray applet to update your system via Arch-Update (you can answer "Y"es to all questions). This will trigger another tooltip update accordingly, like so:

2024-10-01_01-49

You should see that you need to reload nwg-panel (e.g. with nwg-panel -sigdwl 1) to get the tooltip updated (while on other panels, like xfce4-panel for instance, it is updated in real time).

You can repeat steps 5 and 6 as much as you need to generate tooltips updates 😉

Hopefully this is clear enough 😅
Let me know if not :)

@nwg-piotr
Copy link
Owner

LOL, I was just about to write a python script to create an icon and update the tooltip text once a second. 🤣 Either way, this needs to wait till the evening, as I'm leaving the office in 20 minutes.

@Antiz96
Copy link
Author

Antiz96 commented Oct 1, 2024

LOL, I was just about to write a python script to create an icon and update the tooltip text once a second. 🤣

Well, sure that would work lol. Whatever feels easier to you 🤣
At least you know in which context I'm using this now 😆

Either way, this needs to wait till the evening, as I'm leaving the office in 20 minutes.

Yeah no problem :) Thanks 🙏

nwg-piotr added a commit that referenced this issue Oct 2, 2024
@nwg-piotr
Copy link
Owner

nwg-piotr commented Oct 2, 2024

It works well now.

[edit] I removed some irrelevant replies above.

@Antiz96
Copy link
Author

Antiz96 commented Oct 2, 2024

I confirm it works as intended with v0.9.40! Thanks a lot :D

@nwg-piotr
Copy link
Owner

nwg-piotr commented Oct 2, 2024

You are welcome! A couple of lines of code were missing. It took time to find it, as it's not my code. :)

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

2 participants