diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock index 7512f409054..1132c540d47 100644 --- a/components/servo/Cargo.lock +++ b/components/servo/Cargo.lock @@ -273,7 +273,7 @@ dependencies = [ [[package]] name = "cocoa" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -811,7 +811,7 @@ dependencies = [ "net_traits 0.0.1", "script_traits 0.0.1", "servo-egl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "servo-glutin 0.4.15 (registry+https://github.com/rust-lang/crates.io-index)", + "servo-glutin 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)", "style_traits 0.0.1", "url 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "util 0.0.1", @@ -1974,12 +1974,12 @@ dependencies = [ [[package]] name = "servo-glutin" -version = "0.4.15" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "android_glue 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "cgl 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "cocoa 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cocoa 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "dwmapi-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2015,7 +2015,7 @@ dependencies = [ "servo-egl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "servo-fontconfig 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "servo-freetype-sys 2.4.11 (registry+https://github.com/rust-lang/crates.io-index)", - "servo-glutin 0.4.15 (registry+https://github.com/rust-lang/crates.io-index)", + "servo-glutin 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)", "x11 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock index 8832485efbf..f7c5cde6ca7 100644 --- a/ports/cef/Cargo.lock +++ b/ports/cef/Cargo.lock @@ -4,7 +4,7 @@ version = "0.0.1" dependencies = [ "azure 0.4.3 (git+https://github.com/servo/rust-azure)", "cgl 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "cocoa 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cocoa 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "compositing 0.0.1", "core-foundation 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -258,7 +258,7 @@ dependencies = [ [[package]] name = "cocoa" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -731,7 +731,7 @@ dependencies = [ "net_traits 0.0.1", "script_traits 0.0.1", "servo-egl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "servo-glutin 0.4.15 (registry+https://github.com/rust-lang/crates.io-index)", + "servo-glutin 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)", "style_traits 0.0.1", "url 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "util 0.0.1", @@ -1868,12 +1868,12 @@ dependencies = [ [[package]] name = "servo-glutin" -version = "0.4.15" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "android_glue 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "cgl 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "cocoa 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cocoa 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "dwmapi-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1909,7 +1909,7 @@ dependencies = [ "servo-egl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "servo-fontconfig 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "servo-freetype-sys 2.4.11 (registry+https://github.com/rust-lang/crates.io-index)", - "servo-glutin 0.4.15 (registry+https://github.com/rust-lang/crates.io-index)", + "servo-glutin 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)", "x11 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/ports/glutin/window.rs b/ports/glutin/window.rs index 1a130a43d2c..6ae14334f51 100644 --- a/ports/glutin/window.rs +++ b/ports/glutin/window.rs @@ -13,6 +13,8 @@ use euclid::size::TypedSize2D; use euclid::{Size2D, Point2D}; use gleam::gl; use glutin; +#[cfg(target_os = "macos")] +use glutin::os::macos::{ActivationPolicy, WindowBuilderExt}; use glutin::{Api, ElementState, Event, GlRequest, MouseButton, VirtualKeyCode, MouseScrollDelta}; use glutin::{TouchPhase}; use layers::geometry::DevicePixel; @@ -65,6 +67,22 @@ const LINE_HEIGHT: f32 = 38.0; const MULTISAMPLES: u16 = 16; +#[cfg(target_os = "macos")] +fn builder_with_platform_options(mut builder: glutin::WindowBuilder) -> glutin::WindowBuilder { + if opts::get().headless || opts::get().output_file.is_some() { + // Prevent the window from showing in Dock.app, stealing focus, + // or appearing at all when running in headless mode or generating an + // output file. + builder = builder.with_activation_policy(ActivationPolicy::Prohibited) + } + builder +} + +#[cfg(not(target_os = "macos"))] +fn builder_with_platform_options(builder: glutin::WindowBuilder) -> glutin::WindowBuilder { + builder +} + /// The type of a window. pub struct Window { window: glutin::Window, @@ -113,6 +131,8 @@ impl Window { builder = builder.with_multisampling(MULTISAMPLES) } + builder = builder_with_platform_options(builder); + let mut glutin_window = builder.build().unwrap(); unsafe { glutin_window.make_current().expect("Failed to make context current!") } diff --git a/ports/gonk/Cargo.lock b/ports/gonk/Cargo.lock index 68cb39fd0f4..1333efcd412 100644 --- a/ports/gonk/Cargo.lock +++ b/ports/gonk/Cargo.lock @@ -251,7 +251,7 @@ dependencies = [ [[package]] name = "cocoa" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1849,12 +1849,12 @@ dependencies = [ [[package]] name = "servo-glutin" -version = "0.4.15" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "android_glue 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "cgl 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "cocoa 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cocoa 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "dwmapi-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1890,7 +1890,7 @@ dependencies = [ "servo-egl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "servo-fontconfig 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "servo-freetype-sys 2.4.11 (registry+https://github.com/rust-lang/crates.io-index)", - "servo-glutin 0.4.15 (registry+https://github.com/rust-lang/crates.io-index)", + "servo-glutin 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)", "x11 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ]