From c6a123321deb4aae328923e002f3978f9fd394ee Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Tue, 5 Dec 2023 05:48:11 +0100 Subject: [PATCH] Update objc2 and icrate versions --- CHANGELOG.md | 2 ++ glutin/Cargo.toml | 6 ++---- glutin/src/api/cgl/appkit.rs | 6 +++--- glutin/src/api/cgl/surface.rs | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9a5cccb40..6dae731614 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Unreleased +- Updated `objc2` and `icrate` versions. + # Version 0.31.2 - Fixed EGL not setting context version with EGL versions before 1.5 and missing context ext. diff --git a/glutin/Cargo.toml b/glutin/Cargo.toml index 4e8e6f2417..3cee6aec8f 100644 --- a/glutin/Cargo.toml +++ b/glutin/Cargo.toml @@ -52,12 +52,10 @@ x11-dl = { version = "2.20.0", optional = true } [target.'cfg(any(target_os = "macos"))'.dependencies] cgl = "0.3.2" core-foundation = "0.9.3" -# Enable `relax-void-encoding` until https://github.com/madsmtm/objc2/pull/526 is resolved -objc2 = { version = "0.4.1", features = ["relax-void-encoding"] } -dispatch = "0.2.0" +objc2 = "0.5.0" [target.'cfg(any(target_os = "macos"))'.dependencies.icrate] -version = "0.0.4" +version = "0.1.0" features = [ "dispatch", "Foundation", diff --git a/glutin/src/api/cgl/appkit.rs b/glutin/src/api/cgl/appkit.rs index 325f28c99d..9d3c420e4e 100644 --- a/glutin/src/api/cgl/appkit.rs +++ b/glutin/src/api/cgl/appkit.rs @@ -17,7 +17,7 @@ pub struct CGLContextObj { } unsafe impl RefEncode for CGLContextObj { - const ENCODING_REF: Encoding = Encoding::Pointer(&Encoding::Void); + const ENCODING_REF: Encoding = Encoding::Pointer(&Encoding::Struct("_CGLContextObject", &[])); } extern_class!( @@ -42,7 +42,7 @@ extern_methods!( #[method_id(initWithFormat:shareContext:)] pub(crate) fn initWithFormat_shareContext( - this: Option>, + this: Allocated, format: &NSOpenGLPixelFormat, share: Option<&NSOpenGLContext>, ) -> Option>; @@ -97,7 +97,7 @@ extern_methods!( unsafe impl NSOpenGLPixelFormat { #[method_id(initWithAttributes:)] unsafe fn initWithAttributes( - this: Option>, + this: Allocated, attrs: *const NSOpenGLPixelFormatAttribute, ) -> Option>; diff --git a/glutin/src/api/cgl/surface.rs b/glutin/src/api/cgl/surface.rs index 31d1b6d2d5..46b6ee7cdd 100644 --- a/glutin/src/api/cgl/surface.rs +++ b/glutin/src/api/cgl/surface.rs @@ -109,7 +109,7 @@ impl GlSurface for Surface { fn width(&self) -> Option { let window = &self.ns_window; let view = &self.ns_view; - MainThreadMarker::run_on_main(|mtm| unsafe { + MainThreadMarker::run_on_main(|mtm| { let scale_factor = window.get(mtm).backingScaleFactor(); let frame = view.get(mtm).frame(); Some((frame.size.width * scale_factor) as u32) @@ -119,7 +119,7 @@ impl GlSurface for Surface { fn height(&self) -> Option { let window = &self.ns_window; let view = &self.ns_view; - MainThreadMarker::run_on_main(|mtm| unsafe { + MainThreadMarker::run_on_main(|mtm| { let scale_factor = window.get(mtm).backingScaleFactor(); let frame = view.get(mtm).frame(); Some((frame.size.height * scale_factor) as u32)