Open a background non-focus-stealing window for tests on OS X.

Use false for the glfw::Visible window hint to open a background window
on OS X. This requires an upgrade to glfw 3.0.4 in order for this to
also not steal focus.
This commit is contained in:
Cameron Zwarich 2014-05-07 14:19:57 -07:00
parent 15d3257a29
commit d766cbab6e
5 changed files with 6 additions and 5 deletions

View file

@ -117,7 +117,7 @@ impl IOCompositor {
port: Receiver<Msg>, port: Receiver<Msg>,
constellation_chan: ConstellationChan, constellation_chan: ConstellationChan,
profiler_chan: ProfilerChan) -> IOCompositor { profiler_chan: ProfilerChan) -> IOCompositor {
let window: Rc<Window> = WindowMethods::new(app); let window: Rc<Window> = WindowMethods::new(app, opts.output_file.is_none());
// Create an initial layer tree. // Create an initial layer tree.
// //

View file

@ -103,8 +103,9 @@ pub struct Window {
impl WindowMethods<Application> for Window { impl WindowMethods<Application> for Window {
/// Creates a new window. /// Creates a new window.
fn new(app: &Application) -> Rc<Window> { fn new(app: &Application, is_foreground: bool) -> Rc<Window> {
// Create the GLFW window. // Create the GLFW window.
app.glfw.window_hint(glfw::Visible(is_foreground));
let (glfw_window, events) = app.glfw.create_window(800, 600, "Servo", glfw::Windowed) let (glfw_window, events) = app.glfw.create_window(800, 600, "Servo", glfw::Windowed)
.expect("Failed to create GLFW window"); .expect("Failed to create GLFW window");
glfw_window.make_current(); glfw_window.make_current();

View file

@ -61,7 +61,7 @@ pub struct Window {
impl WindowMethods<Application> for Window { impl WindowMethods<Application> for Window {
/// Creates a new window. /// Creates a new window.
fn new(_: &Application) -> Rc<Window> { fn new(_: &Application, _: bool) -> Rc<Window> {
// Create the GLUT window. // Create the GLUT window.
glut::init_window_size(800, 600); glut::init_window_size(800, 600);
let glut_window = glut::create_window("Servo".to_owned()); let glut_window = glut::create_window("Servo".to_owned());

View file

@ -56,7 +56,7 @@ pub trait ApplicationMethods {
pub trait WindowMethods<A> { pub trait WindowMethods<A> {
/// Creates a new window. /// Creates a new window.
fn new(app: &A) -> Rc<Self>; fn new(app: &A, is_foreground: bool) -> Rc<Self>;
/// Returns the size of the window. /// Returns the size of the window.
fn size(&self) -> Size2D<f32>; fn size(&self) -> Size2D<f32>;
/// Presents the window to the screen (perhaps by page flipping). /// Presents the window to the screen (perhaps by page flipping).

@ -1 +1 @@
Subproject commit c2bf133193a10d02334a413d40091a15ebca6cc1 Subproject commit bf90cb8b336b2cfb49572dd964c5d2c23297502e