aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Badawy <adambada@buffalo.edu>2015-10-25 21:56:49 -0400
committerAdam Badawy <adambada@buffalo.edu>2015-10-25 21:56:49 -0400
commited8dfa9a52e4034c50bf0fd87c89484bffb043f0 (patch)
tree05b311cd6f79d9d755ed248ac8dc368596b09181 /src
parent918dc6799269cc36268d4f71431344315a213ccb (diff)
downloadglutin-ed8dfa9a52e4034c50bf0fd87c89484bffb043f0.tar.gz
glutin-ed8dfa9a52e4034c50bf0fd87c89484bffb043f0.zip
Fix issue #509
Focusing the newly created window seems to grab the keyboard.
Diffstat (limited to 'src')
-rw-r--r--src/api/x11/window.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/api/x11/window.rs b/src/api/x11/window.rs
index 8ab87de..b6a9621 100644
--- a/src/api/x11/window.rs
+++ b/src/api/x11/window.rs
@@ -565,6 +565,16 @@ impl Window {
input_handler: Mutex::new(XInputEventHandler::new(display, window, ic, window_attrs))
};
+ unsafe {
+ let ref x_window: &XWindow = window.x.borrow();
+ (display.xlib.XSetInputFocus)(
+ display.display,
+ x_window.window,
+ ffi::RevertToParent,
+ ffi::CurrentTime
+ );
+ }
+
// returning
Ok(window)
}