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

macOS disallow_highdpi will set explicity the value to avoid the SO value by default #2339

Merged
merged 5 commits into from
Jun 16, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/platform_impl/macos/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,13 @@ unsafe fn create_view(
) -> Option<(IdRef, Weak<Mutex<CursorState>>)> {
let (ns_view, cursor_state) = new_view(ns_window);
ns_view.non_nil().map(|ns_view| {
// The default value of `setWantsBestResolutionOpenGLSurface_` was `false` until
// macos 10.14 and `true` after 10.5, we should set it to `YES` o `NO` to avoid
// always the default system value in favour of the user's code
Nazariglez marked this conversation as resolved.
Show resolved Hide resolved
if !pl_attribs.disallow_hidpi {
ns_view.setWantsBestResolutionOpenGLSurface_(YES);
} else {
ns_view.setWantsBestResolutionOpenGLSurface_(NO);
}

// On Mojave, views automatically become layer-backed shortly after being added to
Expand Down