Skip to content

Commit

Permalink
Fix dpi_scale() on Windows
Browse files Browse the repository at this point in the history
dpi_scale() would always return 1 on Windows despite setting high_dpi to true and my dpi settings at 150%.

This is fixed by calling init_dpi on display before setting dpi_scale to display.window_scale.
  • Loading branch information
InZan17 authored and not-fl3 committed Apr 11, 2024
1 parent 961795b commit 8c942d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/native/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,7 @@ where
event_handler: None,
modal_resizing_timer: 0,
};
display.init_dpi(conf.high_dpi);

let (tx, rx) = std::sync::mpsc::channel();
let clipboard = Box::new(clipboard::WindowsClipboard::new());
Expand All @@ -855,7 +856,6 @@ where
});

display.update_dimensions(wnd);
display.init_dpi(conf.high_dpi);

let mut wgl = wgl::Wgl::new(&mut display);
let gl_ctx = wgl.create_context(
Expand Down

0 comments on commit 8c942d8

Please sign in to comment.