aboutsummaryrefslogtreecommitdiffstats
path: root/src/osx
diff options
context:
space:
mode:
authorGlenn Watson <gw@intuitionlibrary.com>2014-12-19 08:44:45 +1000
committerGlenn Watson <gw@intuitionlibrary.com>2014-12-19 08:44:45 +1000
commitf8d3b232a510428203e3dd0bcc847b07be6a94d4 (patch)
tree03db6f6505248a61fc410a9ee1b49842680cbbf4 /src/osx
parent70f9f8cf43e51cdd90e1a0163c40cfa617b9f511 (diff)
downloadglutin-f8d3b232a510428203e3dd0bcc847b07be6a94d4.tar.gz
glutin-f8d3b232a510428203e3dd0bcc847b07be6a94d4.zip
Add support for visible parameter on mac.
Diffstat (limited to 'src/osx')
-rw-r--r--src/osx/mod.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/osx/mod.rs b/src/osx/mod.rs
index 110113b..9157da6 100644
--- a/src/osx/mod.rs
+++ b/src/osx/mod.rs
@@ -23,7 +23,7 @@ use std::c_str::CString;
use std::mem;
use std::ptr;
-use events::Event::{MouseInput, MouseMoved, ReceivedCharacter, KeyboardInput, Resized, MouseWheel};
+use events::Event::{MouseInput, MouseMoved, ReceivedCharacter, KeyboardInput, MouseWheel};
use events::ElementState::{Pressed, Released};
use events::MouseButton::{LeftMouseButton, RightMouseButton};
use events;
@@ -130,7 +130,7 @@ extern fn window_did_resize(this: id, _: id) -> id {
impl Window {
fn new_impl(dimensions: Option<(uint, uint)>, title: &str, monitor: Option<MonitorID>,
- vsync: bool, _visible: bool) -> Result<Window, CreationError> {
+ vsync: bool, visible: bool) -> Result<Window, CreationError> {
let app = match Window::create_app() {
Some(app) => app,
None => { return Err(OsError(format!("Couldn't create NSApplication"))); },
@@ -151,7 +151,11 @@ impl Window {
unsafe {
app.activateIgnoringOtherApps_(true);
- window.makeKeyAndOrderFront_(nil);
+ if visible {
+ window.makeKeyAndOrderFront_(nil);
+ } else {
+ window.makeKeyWindow();
+ }
}
// Set up the window delegate to receive events