diff options
author | Adam Badawy <adambada@buffalo.edu> | 2015-10-25 21:56:49 -0400 |
---|---|---|
committer | Adam Badawy <adambada@buffalo.edu> | 2015-10-25 21:56:49 -0400 |
commit | ed8dfa9a52e4034c50bf0fd87c89484bffb043f0 (patch) | |
tree | 05b311cd6f79d9d755ed248ac8dc368596b09181 /src | |
parent | 918dc6799269cc36268d4f71431344315a213ccb (diff) | |
download | glutin-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.rs | 10 |
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) } |