Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update objc2 and icrate versions #1649

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
6 changes: 2 additions & 4 deletions glutin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions glutin/src/api/cgl/appkit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand All @@ -42,7 +42,7 @@ extern_methods!(

#[method_id(initWithFormat:shareContext:)]
pub(crate) fn initWithFormat_shareContext(
this: Option<Allocated<Self>>,
this: Allocated<Self>,
format: &NSOpenGLPixelFormat,
share: Option<&NSOpenGLContext>,
) -> Option<Id<Self>>;
Expand Down Expand Up @@ -97,7 +97,7 @@ extern_methods!(
unsafe impl NSOpenGLPixelFormat {
#[method_id(initWithAttributes:)]
unsafe fn initWithAttributes(
this: Option<Allocated<Self>>,
this: Allocated<Self>,
attrs: *const NSOpenGLPixelFormatAttribute,
) -> Option<Id<Self>>;

Expand Down
4 changes: 2 additions & 2 deletions glutin/src/api/cgl/surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl<T: SurfaceTypeTrait> GlSurface<T> for Surface<T> {
fn width(&self) -> Option<u32> {
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)
Expand All @@ -119,7 +119,7 @@ impl<T: SurfaceTypeTrait> GlSurface<T> for Surface<T> {
fn height(&self) -> Option<u32> {
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)
Expand Down