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 window scaling in Gnome Boxes VMs #4886

Open
2 tasks done
Jacalz opened this issue May 28, 2024 · 11 comments
Open
2 tasks done

Incorrect window scaling in Gnome Boxes VMs #4886

Jacalz opened this issue May 28, 2024 · 11 comments
Labels
Accessibility Issues relating to accessibility, such as colorblind users, hard-of-sight users, etc. bug Something isn't working OS:Linux Tickets affecting only Linux Virtual machine Issues when running Fyne in a virtual machine.

Comments

@Jacalz
Copy link
Member

Jacalz commented May 28, 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

The calculations for determining the default Window scale seem to not be working when running Gnome or KDE Plasma in the Gnome Boxes virtual machine manager (haven't tested any other tech like VMWare etc.).

I have attached various comparison images below to showcase this issue.

How to reproduce

  1. Start fyne_demo and notice that the scaling is incorrect.
  2. Open the theme settings and change scaling.

Screenshots

As you can see, the scale is entirely different from Gnome and it isn't quite possible to get it to a good scale factor when using the settings. The comparison images used Rymdport but fyne_demo should work fine as well. The scaling problem is the same on Gnome and Plasma but images uses Plasma for showing wrong scale:

Local vs VM window with normal text size:

image

Setting text size to small on VM is still too large:

image

Setting text size to tiny on VM is too small:

image

Example code

Use fyne_demo and the menu to then open the theme settings.

Fyne version

v2.4.5

Go compiler version

1.22.3

Operating system and version

Fedora Kinoite 40

Additional Information

Display hardware

All of these tests were conducted on a 27" 1440p monitor.

Reported scaling values locally:

image

Reported scaling values from the VM:

image

@Jacalz Jacalz added bug Something isn't working OS:Linux Tickets affecting only Linux Accessibility Issues relating to accessibility, such as colorblind users, hard-of-sight users, etc. labels May 28, 2024
@Jacalz

This comment was marked as outdated.

@andydotxyz
Copy link
Member

Gnome vs Plasma window with normal text size:

How are you managing to run both on the same screen?

Is it possible that one is X11 and the other Wayland?

@Jacalz
Copy link
Member Author

Jacalz commented May 28, 2024

How are you managing to run both on the same screen?

I had the Plasma VM in fullscreen mode and then ungrabbed the mouse pointer from the VM, pressed the super key to enter the overdrive and lastly focused the window running on Gnome. There is no image editing involved.

Is it possible that one is X11 and the other Wayland?

As far as I know, no. Both apps are running in X11-mode through XWayland. Fedora 40 on Plasma does not support the pure X11 session (entirely removed in favour of XWayland). I had Wayland builds running on the same session as part of that testing. My Gnome setup is also running Wayland.

@dweymouth
Copy link
Contributor

I agree with Jacob - this is really bad and should be one of the top priority fixes. It does seem like Fyne apps are almost entirely unusable on KDE Plasma as it is now

@dweymouth
Copy link
Contributor

I'm surprised I haven't had anyone report this though for Supersonic

@Jacalz Jacalz added the blocker Items that would block a forthcoming release label May 29, 2024
@andydotxyz
Copy link
Member

How are you managing to run both on the same screen?

I had the Plasma VM in fullscreen mode and then ungrabbed the mouse pointer from the VM, pressed the super key to enter the overdrive and lastly focused the window running on Gnome. There is no image editing involved.

Is it possible that one is X11 and the other Wayland?

As far as I know, no. Both apps are running in X11-mode through XWayland. Fedora 40 on Plasma does not support the pure X11 session (entirely removed in favour of XWayland). I had Wayland builds running on the same session as part of that testing. My Gnome setup is also running Wayland.

In which case I'd guess this is a duplicate of the issue that Wayland scale is not yet respected.

For scale lookup we use the XRandR information so if this is running as XWayland instead of Wayland then I think that may be the source of the problem. Would be worth getting a report on the xRandR screen information to aid debugging...

@Jacalz
Copy link
Member Author

Jacalz commented May 29, 2024

In which case I'd guess this is a duplicate of the issue that Wayland scale is not yet respected.

You mean #2897? Not necessarily the same given that KDE and Gnome gives entirely different scaling factors. That the application is unusable on KDE is really problematic.

For scale lookup we use the XRandR information so if this is running as XWayland instead of Wayland then I think that may be the source of the problem. Would be worth getting a report on the xRandR screen information to aid debugging...

Neither Gnome or Plasma installs have xrandr installed so I wonder where we get our scaling info from in that case. I installed it and I have attached the reports below.

Xrandr report from Gnome:

Screen 0: minimum 16 x 16, current 4480 x 1440, maximum 32767 x 32767
DP-2 connected primary 2560x1440+1920+0 (normal left inverted right x axis y axis) 600mm x 340mm

Xrandr report from KDE Plasma:

Screen 0: minimum 16 x 16, current 2560 x 1440, maximum 32767 x 32767
DP-2 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 320mm x 200mm

@Jacalz
Copy link
Member Author

Jacalz commented May 30, 2024

I did some more digging into this. It does not seem to be a Wayland/XWayland issue nor KDE Specific in this case. This issue seems to be related to VMs not reporting the screen size correctly. We might need a different way to look up the scaling given that Fedora Workstation (Gnome) and Fedora KDE (KDE Plasma) both have the same scaling issues when running in the VM but neither have it when booting into the live system directly on the hardware.

However, the problem with Steam Deck in Jacalz/rymdport#159 remains. That problem does make Fyne applications entirely unusable on Steam Deck (and maybe other hardware with smaller screens as well?).

@Jacalz Jacalz removed the blocker Items that would block a forthcoming release label May 30, 2024
@Jacalz Jacalz changed the title Wrong window scale on KDE Plasma Incorrect window scaling in Gnome Boxes VMs May 30, 2024
@Jacalz Jacalz added the Virtual machine Issues when running Fyne in a virtual machine. label May 30, 2024
@Jacalz
Copy link
Member Author

Jacalz commented May 30, 2024

Opened #4896 to track Steam Deck changes instead. Relabeled this issue for incorrect scaling in virtual machines.

@andydotxyz
Copy link
Member

andydotxyz commented Jun 6, 2024

It works for my testing in full virtual machines. How can we replicate this (never heard of gnome boxes before)

@Jacalz
Copy link
Member Author

Jacalz commented Jun 6, 2024

The virtual machines that Gnome Boxes manages are full virtual machine as far as I know. It is basically a virtualisation manager for libvirt. I believe it is running either through QEMU or KVM. See https://en.m.wikipedia.org/wiki/GNOME_Boxes for more information.

I suppose you could try to install Gnome Boxes on a Linux machine and see if it replicates for you.

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 OS:Linux Tickets affecting only Linux Virtual machine Issues when running Fyne in a virtual machine.
Projects
None yet
Development

No branches or pull requests

3 participants