mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
auto merge of #2364 : zwarich/servo/issue-2363, r=larsbergstrom
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 requires adding a new parameter to WindowMethods<A>::new. Fixes https://github.com/mozilla/servo/issues/2363. r? @larsbergstrom
This commit is contained in:
commit
2a7889c061
5 changed files with 6 additions and 5 deletions
|
@ -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.
|
||||||
//
|
//
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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());
|
||||||
|
|
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue