Merge pull request #2578 from Jinderamarak/fix-drag-drop-flag
Fix unnecessary COM initialization
This commit is contained in:
commit
8fb939b5a9
1 changed files with 16 additions and 8 deletions
|
|
@ -296,14 +296,22 @@ where
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
let window = match event_loop.create_window(
|
let window = {
|
||||||
winit::window::WindowAttributes::default().with_visible(false),
|
let attributes = winit::window::WindowAttributes::default();
|
||||||
) {
|
|
||||||
Ok(window) => Arc::new(window),
|
#[cfg(target_os = "windows")]
|
||||||
Err(error) => {
|
let attributes = {
|
||||||
self.error = Some(Error::WindowCreationFailed(error));
|
use winit::platform::windows::WindowAttributesExtWindows;
|
||||||
event_loop.exit();
|
attributes.with_drag_and_drop(false)
|
||||||
return;
|
};
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue