diff --git a/Cargo.lock b/Cargo.lock index 33efd6a9dd..7e463741bb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -884,7 +884,7 @@ checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] name = "dpi" version = "0.1.1" -source = "git+https://github.com/raphamorim/winit?rev=0363111#0363111bafb136a163e3a03edd84ce79d1616585" +source = "git+https://github.com/raphamorim/winit?rev=e6433ca#e6433cab7ac59b083c3496da5245af17c112f718" [[package]] name = "dwrote" @@ -3869,7 +3869,7 @@ checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winit" version = "0.30.0" -source = "git+https://github.com/raphamorim/winit?rev=0363111#0363111bafb136a163e3a03edd84ce79d1616585" +source = "git+https://github.com/raphamorim/winit?rev=e6433ca#e6433cab7ac59b083c3496da5245af17c112f718" dependencies = [ "ahash", "android-activity", diff --git a/Cargo.toml b/Cargo.toml index 3df11c1589..089e211ad1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -56,7 +56,7 @@ console_log = "0.2.2" bitflags = "2.5.0" console_error_panic_hook = "0.1.7" # winit = { path = "../winit", default-features = false, features = ["rwh_06"] } -winit = { git = "https://github.com/raphamorim/winit", rev = "0363111", default-features = false, features = ["rwh_06"] } +winit = { git = "https://github.com/raphamorim/winit", rev = "e6433ca", default-features = false, features = ["rwh_06"] } [profile.release] opt-level = 3 diff --git a/frontends/rioterm/src/router/window/mod.rs b/frontends/rioterm/src/router/window/mod.rs index 404066c50d..4d14e22020 100644 --- a/frontends/rioterm/src/router/window/mod.rs +++ b/frontends/rioterm/src/router/window/mod.rs @@ -1,13 +1,3 @@ -// #[cfg(target_os = "macos")] -// use { -// cocoa::base::{id, NO, YES}, -// objc::{msg_send, sel, sel_impl}, -// }; - -// #[cfg(target_os = "macos")] -// use raw_window_handle::HasRawWindowHandle; -// #[cfg(target_os = "macos")] -// use raw_window_handle::RawWindowHandle; use rio_backend::config::window::{Decorations, WindowMode}; use rio_backend::config::Config; use std::rc::Rc; @@ -15,22 +5,9 @@ use winit::window::{CursorIcon, Fullscreen, Icon, ImePurpose, Window, WindowAttr pub const LOGO_ICON: &[u8; 410598] = include_bytes!("./resources/images/rio-logo.ico"); // Terminal W/H contraints -pub const DEFAULT_MINIMUM_WINDOW_HEIGHT: i32 = 150; +pub const DEFAULT_MINIMUM_WINDOW_HEIGHT: i32 = 200; pub const DEFAULT_MINIMUM_WINDOW_WIDTH: i32 = 300; -// #[cfg(target_os = "macos")] -// fn set_has_shadow(window: &Window, has_shadows: bool) { -// let raw_window = match window.raw_window_handle().unwrap() { -// RawWindowHandle::AppKit(handle) => NonNull::from(handle.ns_view).cast() as id, -// _ => return, -// }; - -// let value = if has_shadows { YES } else { NO }; -// unsafe { -// let _: id = msg_send![raw_window, setHasShadow: value]; -// } -// } - #[cfg(all( any(feature = "wayland", feature = "x11"), not(any(target_os = "macos", windows)) @@ -165,8 +142,12 @@ pub fn configure_window(winit_window: Window, config: &Rc) -> Window { let is_transparent = config.window.background_opacity < 1.; winit_window.set_transparent(is_transparent); - // #[cfg(target_os = "macos")] - // set_has_shadow(&winit_window, !is_transparent); + + #[cfg(target_os = "macos")] + { + use winit::platform::macos::WindowExtMacOS; + winit_window.set_has_shadow(!is_transparent); + } winit_window.set_blur(config.window.blur);