Implement public API for high-DPI#319
Implement public API for high-DPI#319tomaka merged 3 commits intorust-windowing:masterfrom kryptan:master
Conversation
src/events.rs
Outdated
| /// * A user changes the desktop scaling value (e.g. in Control Panel on Windows). | ||
| /// * A user moves the application window to a display with a different DPI. This message is sent when a window’s | ||
| /// position changes such that most of its area lies on a monitor with a DPI that is different from the DPI | ||
| /// before the position change. |
There was a problem hiding this comment.
Actually this behavior will be platform dependent.
For example, on wayland, we don't have the information of how much the window covers a monitor. We just have the list of all monitors that display some part of the surface. Thus, the wayland backend will just return the highest dpi factor of all the monitors currently displaying some part of the window.
There was a problem hiding this comment.
I removed that part
| /// | ||
| /// Returns `None` if the window no longer exists. | ||
| #[inline] | ||
| pub fn get_inner_size_points(&self) -> Option<(u32, u32)> { |
There was a problem hiding this comment.
These two functions should be deprecated, not removed instantly.
|
@tomaka |
| /// Returns `None` if the window no longer exists. | ||
| /// | ||
| /// DEPRECATED | ||
| #[inline] |
There was a problem hiding this comment.
I didn't mention it, but it should have a #[deprecated] attribute so that a compiler warning is shown when you use them.
|
Err, sorry for the ping-pong, but the last thing that's missing is an entry in |
…eir implementation assuming get_inner_size() returns size in pixels
|
I updated changelog. Is there anything else that's need to be done? |
|
Thanks |
Since the following pull request rust-windowing/winit#319, `winit` has deprecated `get_inner_size_points()` and `get_inner_size_pixels()`. We replace the deprecated API by `get_inner_size()` and `hidpi_factor()`. The size in points in computed from the returned hidpi_factor.
Add OpenGL 4.3 support to the GL backend, enabling compute shader on non-Metal platforms
As discussed in #105. This pull request contains only changes to the winit API, no implementation in any of the backends yet.
MonitorId::get_hidpi_factor() -> f32method. Currently returns 1 for all backends.WindowEvent::HiDPIFactorChanged(f32).Window::get_inner_size_pointsandWindow::get_inner_size_pixels.