mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-26 22:53:15 -04:00
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:
@@ -151,7 +151,7 @@ impl Window {
|
||||
window_state.set_resizable(attributes.resizable);
|
||||
|
||||
// Set startup mode.
|
||||
match attributes.fullscreen.map(Into::into) {
|
||||
match attributes.fullscreen.0.map(Into::into) {
|
||||
Some(Fullscreen::Exclusive(_)) => {
|
||||
warn!("`Fullscreen::Exclusive` is ignored on Wayland");
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ impl UnownedWindow {
|
||||
let xconn = &event_loop.xconn;
|
||||
let atoms = xconn.atoms();
|
||||
#[cfg(feature = "rwh_06")]
|
||||
let root = match window_attrs.parent_window {
|
||||
let root = match window_attrs.parent_window.0 {
|
||||
Some(rwh_06::RawWindowHandle::Xlib(handle)) => handle.window as xproto::Window,
|
||||
Some(rwh_06::RawWindowHandle::Xcb(handle)) => handle.window.get(),
|
||||
Some(raw) => unreachable!("Invalid raw window handle {raw:?} on X11"),
|
||||
@@ -547,10 +547,10 @@ impl UnownedWindow {
|
||||
if window_attrs.maximized {
|
||||
leap!(window.set_maximized_inner(window_attrs.maximized)).ignore_error();
|
||||
}
|
||||
if window_attrs.fullscreen.is_some() {
|
||||
if window_attrs.fullscreen.0.is_some() {
|
||||
if let Some(flusher) =
|
||||
leap!(window
|
||||
.set_fullscreen_inner(window_attrs.fullscreen.clone().map(Into::into)))
|
||||
.set_fullscreen_inner(window_attrs.fullscreen.0.clone().map(Into::into)))
|
||||
{
|
||||
flusher.ignore_error()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user