dweymouth / supersonic

A lightweight and full-featured cross-platform desktop client for self-hosted music servers
GNU General Public License v3.0
875 stars 45 forks source link

supersonic window keeps jumping to the middle of the screen #394

Open llfw opened 3 months ago

llfw commented 3 months ago

i'm using supersonic 0.10.1 on Wayland, with Sway 1.9 compositor, on FreeBSD 15.0/amd64. supersonic is in a floating (not tiled) window.

seemingly randomly (sometimes after i click something, but not always) the window will jump to the centre of the screen for no apparent reason. no other application does this, only supersonic.

i appreciate this is a bit of a vague bug report but i'm not really sure how to investigate it -- i'm happy to try any troubleshooting steps.

dweymouth commented 3 months ago

Hmm I have no idea why this could be happening, and most likely it's a problem upstream with the Fyne UI toolkit. How are you running Supersonic? (Flatpak or direct installation?) And are you running the X11 build through XWayland, or a -tags wayland build (which is still experimental)?

llfw commented 3 months ago

i'm running it from a normal compiled binary running natively (no sandboxing). i built the binary using the FreeBSD ports framework from a local repository, so it has whatever other stuff ports adds to the build (but this is mostly just about setting correct paths, etc., not anything that would affect the behaviour of the app).

i wasn't using -tags wayland, but i just tried launching it with that and it made no different -- the same behaviour immediately occurred.

llfw commented 3 months ago

sorry, i just noticed you said -tags wayland is a build option. could you briefly describe how to enable that? i am not familiar with Go at all.

dweymouth commented 3 months ago

go build -tags wayland as opposed to just go build. It is still experimental though and the window won't have any window borders in wayland mode, for example. But if you have another way of managing the window size and position you can give it a try.

dweymouth commented 3 months ago

You can follow here https://github.com/fyne-io/fyne/issues/1851 for updates and progress on full Wayland support in the upstream UI toolkit

llfw commented 3 months ago

thanks! i'm waiting for another build to finish but i'll test this afterwards.

It is still experimental though and the window won't have any window borders in wayland mode

fwiw, it's only GNOME who think Wayland clients should provide their own borders. the vast majority of Wayland compositors (including Sway) are opposed to this position and provide their own borders. so that's absolutely fine.

llfw commented 3 months ago

i've updated to 0.11.0 and switched to -tags wayland, and this seems to have fixed the problem, thanks!

however, it's also made the font size too small on my 4K display; for X11 i assume it was using Xft.dpi for scaling, is there an equivalent setting (environment variable, etc.) that it uses for scaling on Wayland?

dweymouth commented 3 months ago

Sorry I was just checking back on old issues and realized I forgot to reply to this. I don't know what it is reading scale from on Wayland. Officially, building a Wayland binary is still experimental with the UI toolkit. But you can set the FYNE_SCALE environment variable to scale up or down the UI (for all applications written with the Fyne toolkit). It's a multiplier, so FYNE_SCALE=1 would be the same as the default scaling and bigger values like say 1.5 increase it.