Fix a weird issue on windows with enabling/disabling rounding

This commit is contained in:
2025-08-04 13:38:09 -07:00
parent 70847f46f0
commit 3b69581f43

View File

@@ -10,7 +10,7 @@ use std::{
time::Duration,
};
use sysinfo::System;
use tauri::{AppHandle, Emitter, Manager};
use tauri::{AppHandle, Emitter, Manager, PhysicalSize};
use tauri_plugin_dialog::{DialogExt, MessageDialogKind};
use tauri_plugin_opener::OpenerExt;
use tauri_plugin_os::platform;
@@ -381,7 +381,12 @@ fn fix_mac_permissions(app: AppHandle, name: String, executable: String) {
#[tauri::command]
fn windows_rounded_corners(app: AppHandle, enabled: bool) {
let _ = app.get_webview_window("main").unwrap().set_shadow(enabled);
let window = app.get_webview_window("main");
let _ = window.clone().unwrap().set_shadow(enabled);
let _ = window
.clone()
.unwrap()
.set_size(PhysicalSize::new(1000.0, 632.0)); // Yes, this is needed.
}
#[cfg_attr(mobile, tauri::mobile_entry_point)]