Refactor SharedState so that it is no longer behind an Arc (#2573)

* Refactor SharedState so that it is no longer behind an Arc

* Always use `Window::lock_shared_state`
This commit is contained in:
Mads Marquart 2022-11-29 12:58:35 +01:00 committed by GitHub
parent 32784af3c4
commit 2a58b785fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 55 additions and 92 deletions

View file

@ -57,10 +57,7 @@ declare_class!(
this.map(|this| {
let scale_factor = window.scale_factor();
Ivar::write(&mut this.window, unsafe {
let window: *const WinitWindow = window;
Id::retain(window as *mut WinitWindow).unwrap()
});
Ivar::write(&mut this.window, window.retain());
Ivar::write(&mut this.initial_fullscreen, initial_fullscreen);
Ivar::write(&mut this.previous_position, None);
Ivar::write(&mut this.previous_scale_factor, scale_factor);