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

Incorrect scaling on Steam Deck screen #4896

Closed
2 tasks done
Jacalz opened this issue May 30, 2024 · 15 comments
Closed
2 tasks done

Incorrect scaling on Steam Deck screen #4896

Jacalz opened this issue May 30, 2024 · 15 comments
Labels
Accessibility Issues relating to accessibility, such as colorblind users, hard-of-sight users, etc. bug Something isn't working

Comments

@Jacalz
Copy link
Member

Jacalz commented May 30, 2024

Checklist

  • I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

Copying over from Jacalz/rymdport#159, Fyne applications are entirely unusable on Steam Deck (maybe even other small screens?). This is really problematic because anyone using a Steam Deck and then installing something like Rymdport or Supersonic on Flathub will be very annoyed because the apps have stopped working.

How to reproduce

  1. Start any Fyne application on Steam Deck.
  2. Notice that scaling makes it impossible to use the app.

Screenshots

image
image

Example code

Use Fyne demo or install Rymdport or Supersonic from Flathub.

Fyne version

v2.4.5

Go compiler version

1.22.3

Operating system and version

SteamOS

Additional Information

See Jacalz/rymdport#159 for more information.

@Jacalz Jacalz added bug Something isn't working Accessibility Issues relating to accessibility, such as colorblind users, hard-of-sight users, etc. labels May 30, 2024
@andydotxyz
Copy link
Member

I don't think this can be universally true as I have seen many apps running on the steam deck. Is it related to user configuration or is this a recent problem?

@andydotxyz
Copy link
Member

Any more information at all? Can the user run fyne_demo or otherwise collect scale data from the device?

@Jacalz
Copy link
Member Author

Jacalz commented Jul 1, 2024

I haven't quite had time to research this more. Maybe we can bring in @dalitz-bazalgette can chime in here?

@dalitz-bazalgette
Copy link

dalitz-bazalgette commented Jul 2, 2024

I did a bit more testing with a fresh install and this scaling issue seems to only happen on X11 (which is what SteamOS uses).

I installed Fedora 39 (because it uses KDE 5.X like SteamOS) on my Steam Deck and found that Rymdport and Supersonic scale correctly in wayland but in X11 they exhibit the issue as they do in SteamOS.

@andydotxyz
Copy link
Member

There must be something more specific going on because X11 normally works really well.
Can you share what hardware / configuration you are testing the X11 with?

@dalitz-bazalgette
Copy link

I'm using the Valve Steam Deck. I did a fresh install of SteamOS and Fedora to make sure it wasn't my configuration that caused it.

Perhaps it's a combination of X11 and the 800x1280 display that causes it.

@Jacalz
Copy link
Member Author

Jacalz commented Jul 2, 2024

For what it is worth, I saw that I have an old but similar report from another user having bad scaling in Rymdport:
image

@Jacalz
Copy link
Member Author

Jacalz commented Jul 2, 2024

@dalitz-bazalgette Thanks for the testing. Does Fedora 40 (with what I presume is the latest KDE Plasma 6.1 desktop) get the same behaviour? I also find it strange that X11 shows issues but not Wayland. As the app is rendering through XWayland, it is usually as good or slightly worse than a pure X11 session.

@andydotxyz
Copy link
Member

Perhaps it's a combination of X11 and the 800x1280 display that causes it.

The resolution should not matter - as long as the screen size is reported correctly... my guess is the RandR API has some incorrect data.

Is it possible to run the fyne_demo app on the device and choose "Advanced" so we can see what information is being detected?

@andydotxyz
Copy link
Member

andydotxyz commented Jul 8, 2024

I have tracked down the source of the issue - the screen is reported (to GLFW at least) as 6x6cm. Instead of being 15.6cm wide. So the scaling is off - it thinks the UI should be 4.5x normal.
If I "fix" that with a small hack in our driver then the scale is determined as 1.7 which sounds about right and gives a good resolution of text:
Screenshot_20240708_224020

I'm not sure how we can fix this at the GLFW layer though - if the XWayland wrapper is reporting it wrong...

@Jacalz
Copy link
Member Author

Jacalz commented Jul 9, 2024

Nice work looking into it. Is there any other way to look up scaling and screen sizes on X11? I mean, many of the other applications seem to be working as far as I understand it.

@andydotxyz
Copy link
Member

Is there any other way to look up scaling and screen sizes on X11?

That is what we are doing, it is being reported incorrectly (as is a known issue with some hardware - though I'm not sure if this is the XWayland or underlying hardware/OS at fault).

I mean, many of the other applications seem to be working as far as I understand it.

Yes. They are doing no attempt at scaling to fit the screen, they are simply 1:1 on pixels, leading to very small text because of the underlying hardware DPI. (see the image above - the desktop text is smaller than Fyne based on a scale of 1 whereas my hacked screen size fix works it out to be 1.7 for the right font size.

andydotxyz added a commit to andydotxyz/fyne that referenced this issue Jul 9, 2024
andydotxyz added a commit to andydotxyz/fyne that referenced this issue Jul 9, 2024
@andydotxyz
Copy link
Member

The PR has a workaround where the scaling isn't correct according to our aims, but is in-keeping with the tiny text of other apps on the system

@andydotxyz
Copy link
Member

andydotxyz commented Jul 9, 2024

OMG I am loving the simplicity of just dropping some Fyne game onto SteamDeck :)

IMG_4952

@andydotxyz
Copy link
Member

Fixed on develop for v2.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accessibility Issues relating to accessibility, such as colorblind users, hard-of-sight users, etc. bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants