From ed8dfa9a52e4034c50bf0fd87c89484bffb043f0 Mon Sep 17 00:00:00 2001 From: Adam Badawy Date: Sun, 25 Oct 2015 21:56:49 -0400 Subject: Fix issue #509 Focusing the newly created window seems to grab the keyboard. --- src/api/x11/window.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/api/x11') 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) } -- cgit v1.2.3