helge17 / tuxguitar

Improve TuxGuitar and provide builds
Other
489 stars 43 forks source link

During playback, bars get rearranged on the screen #554

Closed buryoutougen closed 4 weeks ago

buryoutougen commented 1 month ago

It's hard to come up with a specific example to reproduce, because it depends on the tab contents and probably also on your OS, screen resolution etc., but basically, try to open any larger tab and start playback from different bars. Chances are the layout of the bars will change, with the bar you're in jumping to a different part of the screen.

I think this is caused by the removal of the scrollbar during playback in one of the updates.

guiv42 commented 1 month ago

@buryoutougen : could you please precise your configuration? Especially the version of TuxGuitar you are using. I fixed recently a scrolling issue that was introduced together with the scrollbars removal (#527), it could possibly be linked to your problem.

buryoutougen commented 1 month ago

I tried 2024-08-02-master and 2024-09-28-master (SWT version on Windows 11, 1920x1080 resolution). The behavior is the same.

buryoutougen commented 1 month ago

I recorded my screen to illustrate it better. I'm pressing spacebar (play/pause).

https://github.com/user-attachments/assets/809cf313-d425-4419-91e9-53e39cae8cda

guiv42 commented 1 month ago

Thanks for the precision. The fix I mentioned is already present in 2024-09-28 snapshot, so your problem is something different. I hope I won't have to revert the scrollbar removal, these scrollbars gave me a lot of headaches already (#403).

Edit: I think I understood. When player starts, scrollbars are masked. On windows, this changes the available width to draw the tablature, this probably causes the layout update. I did not see this issue on Linux, where the scrollbars are transparent and vanish when unused, so the available width does not change when they become invisible. I see 2 possible options here:

I'll investigate both, this may take some time...

guiv42 commented 1 month ago

I've possibly found a solution for the clean option (#557). It's a rather aggressive performance optimization, with the objective to fix #403 while keeping scrollbar(s) displayed when playing. Strategy is to repaint only what is needed / when it's needed instead of repainting full tab systematically. App profiling in my test case shows significant improvement, this is encouraging. It deserves to be tested more deeply in next pre-release of master branch, there is a possible risk of regression I think (e.g. tab not refreshed in corner cases?). Note: optimization is only applied when playing.

guiv42 commented 4 weeks ago

Fix is available from pre-release 2024-10-24 in both master and tuxguitar-next branches

buryoutougen commented 4 weeks ago

Works perfectly for me, thanks!