|
|
@ -19,14 +19,15 @@ use crate::INITIAL_DIMENSIONS;
|
|
|
|
#[folder = "assets/"]
|
|
|
|
#[folder = "assets/"]
|
|
|
|
struct Asset;
|
|
|
|
struct Asset;
|
|
|
|
|
|
|
|
|
|
|
|
#[cfg(target_os = "windows")]
|
|
|
|
|
|
|
|
fn windows_fix_dpi() {
|
|
|
|
fn windows_fix_dpi() {
|
|
|
|
|
|
|
|
if cfg!(target_os = "windows") {
|
|
|
|
use winapi::um::winuser::SetProcessDpiAwarenessContext;
|
|
|
|
use winapi::um::winuser::SetProcessDpiAwarenessContext;
|
|
|
|
use winapi::shared::windef::DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2;
|
|
|
|
use winapi::shared::windef::DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2;
|
|
|
|
unsafe {
|
|
|
|
unsafe {
|
|
|
|
SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
|
|
|
|
SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn handle_new_grid_size(new_size: LogicalSize, renderer: &Renderer) {
|
|
|
|
fn handle_new_grid_size(new_size: LogicalSize, renderer: &Renderer) {
|
|
|
|
if new_size.width > 0 && new_size.height > 0 {
|
|
|
|
if new_size.width > 0 && new_size.height > 0 {
|
|
|
@ -60,7 +61,6 @@ pub fn ui_loop() {
|
|
|
|
// Icon::from_rgba(rgba, width, height).expect("Failed to create icon object")
|
|
|
|
// Icon::from_rgba(rgba, width, height).expect("Failed to create icon object")
|
|
|
|
// };
|
|
|
|
// };
|
|
|
|
// info!("icon created");
|
|
|
|
// info!("icon created");
|
|
|
|
|
|
|
|
|
|
|
|
windows_fix_dpi();
|
|
|
|
windows_fix_dpi();
|
|
|
|
|
|
|
|
|
|
|
|
let mut window = video_subsystem.window("Neovide", logical_size.width, logical_size.height)
|
|
|
|
let mut window = video_subsystem.window("Neovide", logical_size.width, logical_size.height)
|
|
|
|