diff --git a/crates/bevy_window/src/window.rs b/crates/bevy_window/src/window.rs index ac442f05f5559..1acf96ee416ac 100644 --- a/crates/bevy_window/src/window.rs +++ b/crates/bevy_window/src/window.rs @@ -291,6 +291,15 @@ pub struct Window { /// /// - Only supported on Windows. pub skip_taskbar: bool, + /// Sets whether the window should draw over its child windows. + /// + /// If `true`, the window excludes drawing over areas obscured by child windows. + /// If `false`, the window can draw over child windows. + /// + /// ## Platform-specific + /// + /// - Only supported on Windows. + pub clip_children: bool, /// Optional hint given to the rendering API regarding the maximum number of queued frames admissible on the GPU. /// /// Given values are usually within the 1-3 range. If not provided, this will default to 2. @@ -451,6 +460,7 @@ impl Default for Window { window_theme: None, visible: true, skip_taskbar: false, + clip_children: true, desired_maximum_frame_latency: None, recognize_pinch_gesture: false, recognize_rotation_gesture: false, diff --git a/crates/bevy_winit/src/winit_windows.rs b/crates/bevy_winit/src/winit_windows.rs index be4a7c21e5f28..f7b948a6bd530 100644 --- a/crates/bevy_winit/src/winit_windows.rs +++ b/crates/bevy_winit/src/winit_windows.rs @@ -126,6 +126,8 @@ impl WinitWindows { use winit::platform::windows::WindowAttributesExtWindows; winit_window_attributes = winit_window_attributes.with_skip_taskbar(window.skip_taskbar); + winit_window_attributes = + winit_window_attributes.with_clip_children(window.clip_children); } #[cfg(target_os = "macos")]