Skip to content

Commit

Permalink
Disable drag_and_drop attribute for boot window
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinderamarak authored and hecrj committed Sep 13, 2024
1 parent d46f6f9 commit cadc054
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions winit/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,14 +296,22 @@ where
return;
};

let window = match event_loop.create_window(
winit::window::WindowAttributes::default().with_visible(false),
) {
Ok(window) => Arc::new(window),
Err(error) => {
self.error = Some(Error::WindowCreationFailed(error));
event_loop.exit();
return;
let window = {
let attributes = winit::window::WindowAttributes::default();

#[cfg(target_os = "windows")]
let attributes = {
use winit::platform::windows::WindowAttributesExtWindows;
attributes.with_drag_and_drop(false)
};

match event_loop.create_window(attributes.with_visible(false)) {
Ok(window) => Arc::new(window),
Err(error) => {
self.error = Some(Error::WindowCreationFailed(error));
event_loop.exit();
return;
}
}
};

Expand Down

0 comments on commit cadc054

Please sign in to comment.