-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Rerun viewer always loads at 2x the size of inner_size_points
from app.ron
#5462
Comments
inner_size_points
from app.roninner_size_points
from app.ron
A bit of debug investigation: The monitor appears to be returning some incorrect value here: egui/crates/egui-winit/src/lib.rs Line 1573 in 36a70e1
On my system this is returning a value of "2", which is definitely wrong, though it's not clear to me if the correct value is 1 or 1.25. By contrast, here: egui/crates/egui-winit/src/window_settings.rs Lines 22 to 24 in 36a70e1
But the fact that I get a doubling every time, rather than an increase of 2/1.25 suggests that the "2" would need to be a "1", so there's still some additional factor in how this needs to fit together to work properly. |
Also, if any other Hyprland users happen to come across this, you can work around it by overriding the size with a windowrule. e.g.:
|
eframe prefers logical coordinates ("ui points") for everything, which means an eframe windows dragged from one screen to another should preserve the same logical size, though get a different physical/pixel size (due to monitors having different scaling). However, this can cause bugs if the DPI scaling is guessed incorrectly on save/load. It is also complicated by egui's scale factor. There also have historically been inconsistencies with how things work in winit based on different platforms. In short: the code is very messy, and I have no clear idea how to make it better. Maybe we should store window size as physical pixels… but then the window is likely to change size if you close the app on one monitor and then open it on another. We could also try storing the DPI scale alongside the window size. Still, by your reports, it seems like the system is inconsistent/unreliable in reporting the scale factor. NOTE: please make sure Relevant and suspicious code can be found in:
|
Confirmed |
Context
Affects: Linux (Arch) on Wayland (Hyprland)
This seems to be related to that fact that I have configured scaling on my monitor.
In
hyprland.conf
:The format for this clause is:
monitor = name, resolution, position, scale
(The same problems occurs for integer scaling using a value like 2)
If I disable scaling and use:
the problem goes away.
Observed behavior
If I start with app.ron showing 640x480
When I launch the viewer, the actual viewer ends up 1280x960:
When I close the viewer, the new 1280x960 value ends up stored back in app.ron:
Which then doubles again on the next load.
The text was updated successfully, but these errors were encountered: