From fe671c65eca4edb2857d2590f9c9d2bd56166d9b Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Tue, 19 Jul 2022 18:35:16 +0300 Subject: [PATCH] Bump sctk-adwaita to 0.4.1 This should force the use of system libraries for Fontconfig and freetype instead of building them with cmake if missing. Fixes #2373. --- Cargo.toml | 2 +- src/platform_impl/macos/app_delegate.rs | 3 ++- src/platform_impl/macos/view.rs | 3 ++- src/platform_impl/macos/window_delegate.rs | 4 ++-- src/platform_impl/windows/drop_handler.rs | 3 ++- src/platform_impl/windows/event_loop.rs | 2 +- 6 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 403701127da..71719924868 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -103,7 +103,7 @@ features = [ wayland-client = { version = "0.29.4", default_features = false, features = ["use_system_lib"], optional = true } wayland-protocols = { version = "0.29.4", features = [ "staging_protocols"], optional = true } sctk = { package = "smithay-client-toolkit", version = "0.16.0", default_features = false, features = ["calloop"], optional = true } -sctk-adwaita = { version = "0.4.0", optional = true } +sctk-adwaita = { version = "0.4.1", optional = true } mio = { version = "0.8", features = ["os-ext"], optional = true } x11-dl = { version = "2.18.5", optional = true } percent-encoding = { version = "2.0", optional = true } diff --git a/src/platform_impl/macos/app_delegate.rs b/src/platform_impl/macos/app_delegate.rs index 0ba31ecd400..b1085d66b94 100644 --- a/src/platform_impl/macos/app_delegate.rs +++ b/src/platform_impl/macos/app_delegate.rs @@ -1,5 +1,6 @@ use std::{ cell::{RefCell, RefMut}, + mem, os::raw::c_void, }; @@ -72,7 +73,7 @@ extern "C" fn dealloc(this: &Object, _: Sel) { let state_ptr: *mut c_void = *(this.get_ivar(AUX_DELEGATE_STATE_NAME)); // As soon as the box is constructed it is immediately dropped, releasing the underlying // memory - Box::from_raw(state_ptr as *mut RefCell); + mem::drop(Box::from_raw(state_ptr as *mut RefCell)); } } diff --git a/src/platform_impl/macos/view.rs b/src/platform_impl/macos/view.rs index b8c93cb5e23..cde7267dba7 100644 --- a/src/platform_impl/macos/view.rs +++ b/src/platform_impl/macos/view.rs @@ -1,6 +1,7 @@ use std::{ boxed::Box, collections::VecDeque, + mem, os::raw::*, ptr, slice, str, sync::{ @@ -325,7 +326,7 @@ extern "C" fn dealloc(this: &Object, _sel: Sel) { let marked_text: id = *this.get_ivar("markedText"); let _: () = msg_send![marked_text, release]; let state: *mut c_void = *this.get_ivar("winitState"); - Box::from_raw(state as *mut ViewState); + mem::drop(Box::from_raw(state as *mut ViewState)); } } diff --git a/src/platform_impl/macos/window_delegate.rs b/src/platform_impl/macos/window_delegate.rs index bb855cd5efd..4243af7dec4 100644 --- a/src/platform_impl/macos/window_delegate.rs +++ b/src/platform_impl/macos/window_delegate.rs @@ -1,5 +1,5 @@ use std::{ - f64, + f64, mem, os::raw::c_void, sync::{Arc, Weak}, }; @@ -241,7 +241,7 @@ fn with_state T, T>(this: &Object, callba extern "C" fn dealloc(this: &Object, _sel: Sel) { with_state(this, |state| unsafe { - Box::from_raw(state as *mut WindowDelegateState); + mem::drop(Box::from_raw(state as *mut WindowDelegateState)); }); } diff --git a/src/platform_impl/windows/drop_handler.rs b/src/platform_impl/windows/drop_handler.rs index f273ad00366..3f8509d4c24 100644 --- a/src/platform_impl/windows/drop_handler.rs +++ b/src/platform_impl/windows/drop_handler.rs @@ -1,5 +1,6 @@ use std::{ ffi::{c_void, OsString}, + mem, os::windows::ffi::OsStringExt, path::PathBuf, ptr, @@ -80,7 +81,7 @@ impl FileDropHandler { let count = drop_handler.refcount.fetch_sub(1, Ordering::Release) - 1; if count == 0 { // Destroy the underlying data - Box::from_raw(drop_handler as *mut FileDropHandlerData); + mem::drop(Box::from_raw(drop_handler as *mut FileDropHandlerData)); } count as u32 } diff --git a/src/platform_impl/windows/event_loop.rs b/src/platform_impl/windows/event_loop.rs index 870f323d965..b41c9ed79e5 100644 --- a/src/platform_impl/windows/event_loop.rs +++ b/src/platform_impl/windows/event_loop.rs @@ -923,7 +923,7 @@ pub(super) unsafe extern "system" fn public_window_callback( }; if userdata_removed && recurse_depth == 0 { - Box::from_raw(userdata_ptr); + mem::drop(Box::from_raw(userdata_ptr)); } result