Focusing the newly created window seems to grab the keyboard.
This commit is contained in:
Adam Badawy 2015-10-25 21:56:49 -04:00
parent 918dc67992
commit ed8dfa9a52

View file

@ -565,6 +565,16 @@ impl Window {
input_handler: Mutex::new(XInputEventHandler::new(display, window, ic, window_attrs)) 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 // returning
Ok(window) Ok(window)
} }