mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
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:
parent
15d3257a29
commit
d766cbab6e
5 changed files with 6 additions and 5 deletions
|
@ -117,7 +117,7 @@ impl IOCompositor {
|
|||
port: Receiver<Msg>,
|
||||
constellation_chan: ConstellationChan,
|
||||
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.
|
||||
//
|
||||
|
|
|
@ -103,8 +103,9 @@ pub struct Window {
|
|||
|
||||
impl WindowMethods<Application> for Window {
|
||||
/// Creates a new window.
|
||||
fn new(app: &Application) -> Rc<Window> {
|
||||
fn new(app: &Application, is_foreground: bool) -> Rc<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)
|
||||
.expect("Failed to create GLFW window");
|
||||
glfw_window.make_current();
|
||||
|
|
|
@ -61,7 +61,7 @@ pub struct Window {
|
|||
|
||||
impl WindowMethods<Application> for Window {
|
||||
/// Creates a new window.
|
||||
fn new(_: &Application) -> Rc<Window> {
|
||||
fn new(_: &Application, _: bool) -> Rc<Window> {
|
||||
// Create the GLUT window.
|
||||
glut::init_window_size(800, 600);
|
||||
let glut_window = glut::create_window("Servo".to_owned());
|
||||
|
|
|
@ -56,7 +56,7 @@ pub trait ApplicationMethods {
|
|||
|
||||
pub trait WindowMethods<A> {
|
||||
/// 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.
|
||||
fn size(&self) -> Size2D<f32>;
|
||||
/// Presents the window to the screen (perhaps by page flipping).
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit c2bf133193a10d02334a413d40091a15ebca6cc1
|
||||
Subproject commit bf90cb8b336b2cfb49572dd964c5d2c23297502e
|
Loading…
Add table
Add a link
Reference in a new issue