-
Notifications
You must be signed in to change notification settings - Fork 222
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
Everything is too huge #61
Comments
Yeah, I've noticed this too, it's that winit reports a wrong DPI factor on Linux - for me it reports a factor of 1.33 except that I don't have a HiDPI screen. This is less of a problem with azul and rather a problem with winit (which both azul and servo use). For now I've simply taken it as a test that HiDPI does indeed work and that azul isn't locked to 2x scaling. I know about this bug, but this has to do with winit reporting the factor incorrectly. On Windows, scaling works normally, can't speak for Mac. |
What's the status on this? I'm a little confused because the referenced issue seems to have been solved months before it was even referenced... |
Yeah, it's still a problem. As far as I can see this function here: https://github.com/tomaka/winit/blob/3c59283b3fbf409353413c0c0d7d39ae85287e60/src/platform/linux/x11/util/randr.rs#L7-L38 returns the wrong output - winit calculates the DPI factor "manually" on X11. However, I've checked the math with xrandr and I can't find anything wrong with it - on my screen, it would come out to a factor of 1.0, but winit reports a factor or 1.333 for some reason. Second, it's not the proper way to do HiDPI on Linux. In order to "properly" solve this, the DPI factor would have to be read out of the GSettings database (so that it can be adjusted on-the-fly). However, I want to avoid binding to Gnome libraries. As I've found out, the DPI settings are stored in An intermediary fix is to simply disable HiDPI on screens with less than 1920x1080, because usually those screens don't have any real HiDPI needs. |
It appears that the dimensions that |
Well, which one is correct, xdpyinfo or xrandr? How large is your monitor really, 381x214 or 309x174? The problem is that xdpyinfo is a seperate tool that can't be relied on to be present on the users machine and in the end, xdpyinfo should technically just get its info from xrandr, so I'm not sure why it returns two different values. |
In terms of screen size, xandr is correct. My screen is 309x174. |
Yes, I just manually calculated the steps in the function and to me it seems that the function operates correctly - your "DPI factor" is 1.25. However, there seems to be a system setting that overrides the 1.25 with 1.0 again (which xdpyinfo seems to use). xdpyinfo seems to hard-code a DPI of 96 no matter what, so it's completely unreliable, see https://bugzilla.redhat.com/show_bug.cgi?id=863669. The best way right now seems to use, in that order:
Then seem to be 10 other ways of getting a DPI value, some of which work, some of which don't - correct DPI handling on Linux has always been a mess |
So it seems like it will be a while before this gets solved. |
Yeah, use |
Alright, I'll give that a go :) |
So, I was looking into this again and turns out that using glutin's get_hidpi_factor method on the window returns a value much closer to the truth than the current value azul is using. It's giving me I've noticed that azul has access to glutin through the azul-glium fork, I don't know much about the specifics of how that's used, but since the library is already there, maybe we could get the hidpi factor from there as a semi-fix? Edit: Nvm, I was testing that on my second, larger, monitor. Jumped the gun on that one... |
- DisplayListParameters now carries the WindowSize, this is also a preparation for implementing vh, vw, vmin, vmax - on resize events the DPI is queried from the system (by parsing gsettings CLI). This also makes the DPI respond to DPI resizing under Ubuntu. Fixes #61.
Description
When I start the demo app, it is about twice as large as my screen. The font appears to be about double what it's supposed to be.
Version / OS
azul version: 0.1.0
Operating system: Debian linux, openbox window manager
Windowing system (X11 or Wayland, Linux only): X11
Expected Behavior
Draw from system info that doesn't lie about the dpi or the screen size, or do some sanity checking to notice when that info is lies and do something sensible instead
Actual Behavior
Similar to Servo, everything is too huge (the problem might be upstream, but I'm reluctant to report it to servo, because in servo's case the issue is confounded with many other problems happening at the same time.)
Additional Information
This issue may have something to do with the fact I'm using a tv as a monitor. Until recently, many other apps had similar issues, either rendering text and icons way too large (most qt apps), or, strangely, in the case of openbox and tint2, rendering text way too small. Most apps, though (chrome, firefox, terminals, other gtk apps), got along fine.
While reporting this bug, though, I got around to creating a ~/.Xresources file, containing
Xft.dpi: 75
. This has corrected all of the offending programs I was aware of, but it has not corrected the azul demo.The text was updated successfully, but these errors were encountered: