[bugfix] Fix window scaling issue when dragging between monitors.
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
|
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
|
||||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||||
|
|
||||||
// use tauri::command;
|
|
||||||
use tauri::Manager;
|
use tauri::Manager;
|
||||||
use window_shadows::set_shadow;
|
use window_shadows::set_shadow;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
tauri::Builder::default()
|
tauri::Builder::default()
|
||||||
.setup(|app| {
|
.setup(|app| {
|
||||||
@@ -17,6 +17,11 @@ fn main() {
|
|||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
|
.on_window_event(|event| { // This is for fix the bug that the window scaling issue when dragging between monitors.
|
||||||
|
if let tauri::WindowEvent::ScaleFactorChanged { new_inner_size, .. } = event.event() {
|
||||||
|
event.window().set_size(tauri::Size::Physical(*new_inner_size)).unwrap();
|
||||||
|
}
|
||||||
|
})
|
||||||
.invoke_handler(tauri::generate_handler![get_font_list])
|
.invoke_handler(tauri::generate_handler![get_font_list])
|
||||||
.run(tauri::generate_context!())
|
.run(tauri::generate_context!())
|
||||||
.expect("error while running tauri application");
|
.expect("error while running tauri application");
|
||||||
|
|||||||
Reference in New Issue
Block a user