Make WindowBuilder Send + Sync

Window builder is always accessed by winit on the thread event loop
is on, thus it's safe to mark the data it gets as `Send + Sync`.
Each unsafe object is marked individually as `Send + Sync` instead
of just implementing `Send` and `Sync` for the whole builder.
This commit is contained in:
Kirill Chibisov 2023-10-17 04:54:12 +04:00 committed by GitHub
parent 3ad64fb811
commit 801fddbfcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 72 additions and 47 deletions

View file

@ -1185,8 +1185,8 @@ impl<'a, T: 'static> InitData<'a, T> {
win.set_enabled_buttons(attributes.enabled_buttons);
if attributes.fullscreen.is_some() {
win.set_fullscreen(attributes.fullscreen.map(Into::into));
if attributes.fullscreen.0.is_some() {
win.set_fullscreen(attributes.fullscreen.0.map(Into::into));
unsafe { force_window_active(win.window.0) };
} else {
let size = attributes
@ -1272,7 +1272,7 @@ where
};
#[cfg(feature = "rwh_06")]
let parent = match attributes.parent_window {
let parent = match attributes.parent_window.0 {
Some(rwh_06::RawWindowHandle::Win32(handle)) => {
window_flags.set(WindowFlags::CHILD, true);
if pl_attribs.menu.is_some() {