diff --git a/crates/deadlib-renderer/src/window_size.rs b/crates/deadlib-renderer/src/window_size.rs index de889b06..f0180658 100644 --- a/crates/deadlib-renderer/src/window_size.rs +++ b/crates/deadlib-renderer/src/window_size.rs @@ -5,12 +5,14 @@ use winit::{ }; #[cfg(target_os = "macos")] -use winit::{dpi::LogicalSize, platform::macos::WindowAttributesExtMacOS}; +use winit::dpi::LogicalSize; #[cfg(target_os = "macos")] #[inline(always)] const fn macos_opengl_low_dpi(backend_type: BackendType, high_dpi: bool) -> bool { - backend_type == BackendType::OpenGL && !high_dpi + // `matches!` rather than `==`: `PartialEq::eq` is not callable in a `const fn` + // on stable, but pattern matching is. + matches!(backend_type, BackendType::OpenGL) && !high_dpi } #[cfg(not(target_os = "macos"))] diff --git a/crates/deadsync-shell/src/window.rs b/crates/deadsync-shell/src/window.rs index feece062..d0503a07 100644 --- a/crates/deadsync-shell/src/window.rs +++ b/crates/deadsync-shell/src/window.rs @@ -9,6 +9,8 @@ use deadlib_renderer::{render_size_for_window, request_window_size, with_request use deadsync_config::app_config::DisplayMode; use winit::dpi::{PhysicalPosition, PhysicalSize}; use winit::event_loop::ActiveEventLoop; +#[cfg(target_os = "macos")] +use winit::platform::macos::WindowAttributesExtMacOS; use winit::window::{Icon, Window}; const WINDOW_ICON_PATHS: [&str; 2] = [