mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 22:31:30 +11:00
Update for Rustc
This commit is contained in:
parent
bfd21793a8
commit
885d5e9c38
|
@ -102,7 +102,7 @@ impl WindowProxy {
|
||||||
impl Window {
|
impl Window {
|
||||||
/// See the docs in the crate root file.
|
/// See the docs in the crate root file.
|
||||||
pub fn is_closed(&self) -> bool {
|
pub fn is_closed(&self) -> bool {
|
||||||
use std::sync::atomic::Relaxed;
|
use std::sync::atomic::Ordering::Relaxed;
|
||||||
self.is_closed.load(Relaxed)
|
self.is_closed.load(Relaxed)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,7 +213,7 @@ impl Window {
|
||||||
|
|
||||||
// if one of the received events is `Closed`, setting `is_closed` to true
|
// if one of the received events is `Closed`, setting `is_closed` to true
|
||||||
if events.iter().any(|e| match e { &::events::Event::Closed => true, _ => false }) {
|
if events.iter().any(|e| match e { &::events::Event::Closed => true, _ => false }) {
|
||||||
use std::sync::atomic::Relaxed;
|
use std::sync::atomic::Ordering::Relaxed;
|
||||||
self.is_closed.store(true, Relaxed);
|
self.is_closed.store(true, Relaxed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,7 +228,7 @@ impl Window {
|
||||||
// if the received event is `Closed`, setting `is_closed` to true
|
// if the received event is `Closed`, setting `is_closed` to true
|
||||||
match ev {
|
match ev {
|
||||||
::events::Event::Closed => {
|
::events::Event::Closed => {
|
||||||
use std::sync::atomic::Relaxed;
|
use std::sync::atomic::Ordering::Relaxed;
|
||||||
self.is_closed.store(true, Relaxed);
|
self.is_closed.store(true, Relaxed);
|
||||||
},
|
},
|
||||||
_ => ()
|
_ => ()
|
||||||
|
@ -241,7 +241,7 @@ impl Window {
|
||||||
},
|
},
|
||||||
|
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
use std::sync::atomic::Relaxed;
|
use std::sync::atomic::Ordering::Relaxed;
|
||||||
self.is_closed.store(true, Relaxed);
|
self.is_closed.store(true, Relaxed);
|
||||||
RingBuf::new()
|
RingBuf::new()
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ pub fn get_available_monitors() -> RingBuf<MonitorID> {
|
||||||
|
|
||||||
// computing the human-friendly name
|
// computing the human-friendly name
|
||||||
let readable_name = String::from_utf16_lossy(output.DeviceString.as_slice());
|
let readable_name = String::from_utf16_lossy(output.DeviceString.as_slice());
|
||||||
let readable_name = readable_name.as_slice().trim_right_chars(0 as char).to_string();
|
let readable_name = readable_name.as_slice().trim_right_matches(0 as char).to_string();
|
||||||
|
|
||||||
// getting the position
|
// getting the position
|
||||||
let (position, dimensions) = unsafe {
|
let (position, dimensions) = unsafe {
|
||||||
|
|
|
@ -19,7 +19,7 @@ impl HeadlessContext {
|
||||||
Ok(HeadlessContext {
|
Ok(HeadlessContext {
|
||||||
width: dimensions.0,
|
width: dimensions.0,
|
||||||
height: dimensions.1,
|
height: dimensions.1,
|
||||||
buffer: Vec::from_elem(dimensions.0 * dimensions.1, unsafe { mem::uninitialized() }),
|
buffer: ::std::iter::repeat(unsafe { mem::uninitialized() }).take(dimensions.0 * dimensions.1).collect(),
|
||||||
context: unsafe {
|
context: unsafe {
|
||||||
let ctxt = ffi::OSMesaCreateContext(0x1908, ptr::null());
|
let ctxt = ffi::OSMesaCreateContext(0x1908, ptr::null());
|
||||||
if ctxt.is_null() {
|
if ctxt.is_null() {
|
||||||
|
|
|
@ -351,7 +351,7 @@ impl Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_closed(&self) -> bool {
|
pub fn is_closed(&self) -> bool {
|
||||||
use std::sync::atomic::Relaxed;
|
use std::sync::atomic::Ordering::Relaxed;
|
||||||
self.is_closed.load(Relaxed)
|
self.is_closed.load(Relaxed)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -453,7 +453,7 @@ impl Window {
|
||||||
|
|
||||||
ffi::ClientMessage => {
|
ffi::ClientMessage => {
|
||||||
use events::Event::{Closed, Awakened};
|
use events::Event::{Closed, Awakened};
|
||||||
use std::sync::atomic::Relaxed;
|
use std::sync::atomic::Ordering::Relaxed;
|
||||||
|
|
||||||
let client_msg: &ffi::XClientMessageEvent = unsafe { mem::transmute(&xev) };
|
let client_msg: &ffi::XClientMessageEvent = unsafe { mem::transmute(&xev) };
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue