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
Wayland Scaling support: sizes and distances are scaled wrong #2850
Comments
Because of how fragmented Linux is we would need more information. Can you please be specific about how the settings are found, and applied? |
It's part of the core Wayland protocol. The compositor will announce the scaling factor for an output using Looking at the logs, it seems that my sample code above actually receives the event, and replies indicating that its surface will have scaling applied by using $ WAYLAND_DEBUG=1 go run -tags wayland ./main.go 2>&1 | grep scale
[4188969.808] wl_output@15.scale(2)
[4189209.683] -> wl_surface@21.set_buffer_scale(2) Configuring the scaling factor is compositor-specific. I believe GNOME and KDE have a GUI for that. I can't find any documentation for either online so can't provide better pointers. Sway uses the Sway can be run nested inside another compositor, so might be a better target for experimentation. |
Thanks this is very helpful. I guess our wayland code does not pick it up yet, as we use the older X11 based DPI detection to get the appropriate scale. |
|
Fixed on |
Just tested, works great and looks so much better on HiDPI screens on Wayland now, great job! |
Excellent, thanks for checking :) |
Describe the bug:
I'm using desktop scaling, and elements and distances are not scaled correctly. The mouse cursor is also twice the regular size.
Hovering and clicking on items does not work correctly. To click on a button one must click in a very different position (as far as I can tell, the position where the button WOULD be if the window is scale properly).
However, because rendering and mouse events aren't consistent, UIs are entirely unusable with a mouse.
To Reproduce:
On a desktop with scaling enabled, run the example code (see below).
Screenshots:
With scaling:
The same sample ran via XWayland, where scaling is not done by the client. the compositor stretches the image instead (hence the blurryness):
Example code:
Use
go run -tags wayland ./main.go
:Device (please complete the following information):
Linux 5.16.12-arch1-1 GNU/Linux
go version go1.17.8 linux/amd64
I'm using
swaywm
as a wayland compositor. I haven't tried GNOME.The text was updated successfully, but these errors were encountered: