mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-11 05:21:31 +11:00
macOS: disallow_highdpi will set explicity the value to avoid the SO value by default (#2339)
Co-authored-by: Mads Marquart <mads@marquart.dk>
This commit is contained in:
parent
401d20fa1f
commit
ac42447459
|
@ -60,6 +60,7 @@ And please only add new entries to the top of this list, right below the `# Unre
|
||||||
- Implemented `Eq` for `Fullscreen`, `Theme`, and `UserAttentionType`.
|
- Implemented `Eq` for `Fullscreen`, `Theme`, and `UserAttentionType`.
|
||||||
- **Breaking:** `Window::set_cursor_grab` now accepts `CursorGrabMode` to control grabbing behavior.
|
- **Breaking:** `Window::set_cursor_grab` now accepts `CursorGrabMode` to control grabbing behavior.
|
||||||
- On Wayland, add support for `Window::set_cursor_position`.
|
- On Wayland, add support for `Window::set_cursor_position`.
|
||||||
|
- Fix on macOS `WindowBuilder::with_disallow_hidpi`, setting true or false by the user no matter the SO default value.
|
||||||
|
|
||||||
# 0.26.1 (2022-01-05)
|
# 0.26.1 (2022-01-05)
|
||||||
|
|
||||||
|
|
|
@ -100,8 +100,13 @@ unsafe fn create_view(
|
||||||
) -> Option<(IdRef, Weak<Mutex<CursorState>>)> {
|
) -> Option<(IdRef, Weak<Mutex<CursorState>>)> {
|
||||||
let (ns_view, cursor_state) = new_view(ns_window);
|
let (ns_view, cursor_state) = new_view(ns_window);
|
||||||
ns_view.non_nil().map(|ns_view| {
|
ns_view.non_nil().map(|ns_view| {
|
||||||
|
// The default value of `setWantsBestResolutionOpenGLSurface:` was `false` until
|
||||||
|
// macos 10.14 and `true` after 10.15, we should set it to `YES` or `NO` to avoid
|
||||||
|
// always the default system value in favour of the user's code
|
||||||
if !pl_attribs.disallow_hidpi {
|
if !pl_attribs.disallow_hidpi {
|
||||||
ns_view.setWantsBestResolutionOpenGLSurface_(YES);
|
ns_view.setWantsBestResolutionOpenGLSurface_(YES);
|
||||||
|
} else {
|
||||||
|
ns_view.setWantsBestResolutionOpenGLSurface_(NO);
|
||||||
}
|
}
|
||||||
|
|
||||||
// On Mojave, views automatically become layer-backed shortly after being added to
|
// On Mojave, views automatically become layer-backed shortly after being added to
|
||||||
|
|
Loading…
Reference in a new issue