zalesyc / budgie-media-player-applet

Media Control Applet for the Budgie Panel
GNU General Public License v3.0
7 stars 0 forks source link

Text scrolling in the popup is jittery and uses a lot of cpu #12

Open zalesyc opened 1 month ago

zalesyc commented 1 month ago

Description:

The scrolling text in the popup consumes a significant amount of CPU resources, causing jitter and lag, particularly on less powerful or older devices.

There are no particular steps to reproduce this issue.

However, since the text only scrolls when the popup is displayed, this issue is not a major issue as the popup is only open for a short period of time.

This has to be fixed before making it possible for the text in the panel to be scrolled. As that would always use a lot of cpu.

WinnerWind commented 1 month ago

Hi there! Maybe this isn't really possible, but have you considered using zscroll to make this work? image Zscroll will handle all the heavy lifting for you. It's super customizable too, and really stable. The only downside to zscroll is that it scrolls every letter, and not the whole textbox, making it a bit jittery (sort of like an old radio) but it consumes practically no CPU and doesn't randomly jitter like the current version Zscroll in action, where it actually scrolls text.

This could also be extended into the panel, making that scrollable too using this simple solution. Right now I'm looking at the code you made and trying to implement Zscroll support.

zalesyc commented 1 month ago

Hello,

I have considered something similar, but I didn't know about zscroll. I wanted to have a solution that would be smooth, which zscroll isn't, but as you pointed out this may not be possible.

What i looked into the source code of zscroll, the part that does the actual scrolling is quite small, so I would personally just implement the scrolling from scratch, taking inspiration from zscroll, since some adjustments need to be made to adapt the code to Gtk.

WinnerWind commented 1 month ago

Hi there! I wish you luck in your endeavor. Right now I am trying to add support to ZScroll to your applet, but because I don't have much experience in making budgie applets, I can't guarantee anything right now. Good luck!

zalesyc commented 3 weeks ago

I've looked into making the scrolling more performant, but every solution I tried had some problems, so I decided that it is not worth for me to fix it. If someone else wants to create a fix, you are welcome.

I think that this is not large enough issue to stop a release, so I just made scrolling non default, see: #13.

WinnerWind commented 3 weeks ago

Hi there! I'm still working on a solution, I'll keep you posted