From 1fa9127ef76f2217d675ac1b0ea8a7e5fa9c2a6a Mon Sep 17 00:00:00 2001 From: keith Date: Sat, 15 Feb 2020 15:47:45 -0800 Subject: [PATCH] fix mac and linux builds --- src/window.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/window.rs b/src/window.rs index a8fcb0c..5500339 100644 --- a/src/window.rs +++ b/src/window.rs @@ -19,12 +19,13 @@ use crate::INITIAL_DIMENSIONS; #[folder = "assets/"] struct Asset; -#[cfg(target_os = "windows")] fn windows_fix_dpi() { - use winapi::um::winuser::SetProcessDpiAwarenessContext; - use winapi::shared::windef::DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2; - unsafe { - SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); + if cfg!(target_os = "windows") { + use winapi::um::winuser::SetProcessDpiAwarenessContext; + use winapi::shared::windef::DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2; + unsafe { + SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); + } } } @@ -60,7 +61,6 @@ pub fn ui_loop() { // Icon::from_rgba(rgba, width, height).expect("Failed to create icon object") // }; // info!("icon created"); - windows_fix_dpi(); let mut window = video_subsystem.window("Neovide", logical_size.width, logical_size.height)