diff --git a/.changes/shadows-default-on.md b/.changes/shadows-default-on.md new file mode 100644 index 00000000000..23586d7a73c --- /dev/null +++ b/.changes/shadows-default-on.md @@ -0,0 +1,5 @@ +--- +'tauri': 'patch' +--- + +Enable shadows by default. diff --git a/core/tauri-config-schema/schema.json b/core/tauri-config-schema/schema.json index 9d81f421f7e..45358778519 100644 --- a/core/tauri-config-schema/schema.json +++ b/core/tauri-config-schema/schema.json @@ -702,7 +702,7 @@ }, "shadow": { "description": "Whether or not the window has shadow.\n\n## Platform-specific\n\n- **Windows:** - `false` has no effect on decorated window, shadow are always ON. - `true` will make ndecorated window have a 1px white border, and on Windows 11, it will have a rounded corners. - **Linux:** Unsupported.", - "default": false, + "default": true, "type": "boolean" } }, diff --git a/core/tauri-utils/src/config.rs b/core/tauri-utils/src/config.rs index df2cf8db569..dc5f2f1c031 100644 --- a/core/tauri-utils/src/config.rs +++ b/core/tauri-utils/src/config.rs @@ -800,7 +800,7 @@ pub struct WindowConfig { /// - `true` will make ndecorated window have a 1px white border, /// and on Windows 11, it will have a rounded corners. /// - **Linux:** Unsupported. - #[serde(default)] + #[serde(default = "default_true")] pub shadow: bool, } @@ -837,7 +837,7 @@ impl Default for WindowConfig { accept_first_mouse: false, tabbing_identifier: None, additional_browser_args: None, - shadow: false, + shadow: true, } } } diff --git a/examples/api/src-tauri/src/lib.rs b/examples/api/src-tauri/src/lib.rs index 6073043f338..13b343d6843 100644 --- a/examples/api/src-tauri/src/lib.rs +++ b/examples/api/src-tauri/src/lib.rs @@ -54,10 +54,7 @@ pub fn run() { #[cfg(target_os = "windows")] { - window_builder = window_builder - .transparent(true) - .shadow(true) - .decorations(false); + window_builder = window_builder.transparent(true).decorations(false); } let window = window_builder.build().unwrap(); diff --git a/examples/splashscreen/tauri.conf.json b/examples/splashscreen/tauri.conf.json index 5aa68a9975c..edb2c8efdee 100644 --- a/examples/splashscreen/tauri.conf.json +++ b/examples/splashscreen/tauri.conf.json @@ -42,7 +42,6 @@ "width": 400, "height": 200, "decorations": false, - "shadow": true, "resizable": false, "url": "splashscreen.html" } diff --git a/tooling/cli/schema.json b/tooling/cli/schema.json index 9d81f421f7e..45358778519 100644 --- a/tooling/cli/schema.json +++ b/tooling/cli/schema.json @@ -702,7 +702,7 @@ }, "shadow": { "description": "Whether or not the window has shadow.\n\n## Platform-specific\n\n- **Windows:** - `false` has no effect on decorated window, shadow are always ON. - `true` will make ndecorated window have a 1px white border, and on Windows 11, it will have a rounded corners. - **Linux:** Unsupported.", - "default": false, + "default": true, "type": "boolean" } },