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

Minimum and Maximum size become incorrect when the HiDPI factor changes #940

Open
Osspial opened this issue Jun 19, 2019 · 3 comments
Open
Labels
D - easy Likely easier than most tasks here DS - ios DS - macos DS - wayland DS - x11 H - good first issue Ideal for new contributors H - help wanted Someone please save us P - normal Great to have

Comments

@Osspial
Copy link
Contributor

Osspial commented Jun 19, 2019

On most platforms, the set_min_inner_size and set_max_inner_size functions don't handle HiDPI factor changes properly.

Most of the current implementations perform the coordinate-system conversion within the calls to set_{whatever}_size, and store the internal size bounds as either a PhysicalSize or a LogicalSize. That's almost the correct behavior, but it breaks when the window's HiDPI factor changes: if set_{whatever}_size had to do a coordinate system conversion from logical->physical or physical->logical, the size bound will no longer be accurate to what the user requested, since the coordinate system conversion will have changed. Winit should store the Size parameter when one of those functions is called, and update the value passed to the OS whenever a HiDPIFactorChanged event is received.

@Osspial
Copy link
Contributor Author

Osspial commented Jan 2, 2020

Pinging this issue again now that the DPI overhaul has been mostly finished. This still seems to be an issue on Wayland, X11, iOS, and macOS.

@Osspial
Copy link
Contributor Author

Osspial commented Jan 3, 2020

@murarth could you look into addressing this on X11? Looking at the source code, it should be fairly easy to resolve #1353 in the process of resolving this as well.

@murarth
Copy link
Contributor

murarth commented Jan 3, 2020

@Osspial Yes, I'm looking into this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D - easy Likely easier than most tasks here DS - ios DS - macos DS - wayland DS - x11 H - good first issue Ideal for new contributors H - help wanted Someone please save us P - normal Great to have
Development

No branches or pull requests

3 participants