diff options
author | Pierre Krieger <pierre.krieger1708@gmail.com> | 2015-12-24 11:55:39 +0100 |
---|---|---|
committer | Pierre Krieger <pierre.krieger1708@gmail.com> | 2015-12-24 11:55:39 +0100 |
commit | 360d2bf45259970965190a0993db317a67ed729a (patch) | |
tree | 2b74cb3ca008c4c747d48704b1e22713e4ea0a8f /src/api/x11 | |
parent | f76aba3d3778978bef0087f830ebf69954110233 (diff) | |
download | glutin-360d2bf45259970965190a0993db317a67ed729a.tar.gz glutin-360d2bf45259970965190a0993db317a67ed729a.zip |
Call XSync before XSetInputFocus
Diffstat (limited to 'src/api/x11')
-rw-r--r-- | src/api/x11/window.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/api/x11/window.rs b/src/api/x11/window.rs index 297a4f3..1ad5888 100644 --- a/src/api/x11/window.rs +++ b/src/api/x11/window.rs @@ -617,6 +617,10 @@ impl Window { unsafe { let ref x_window: &XWindow = window.x.borrow(); + + // XSetInputFocus generates an error if the window is not visible, + // therefore we call XSync before to make sure it's the case + (display.xlib.XSync)(display.display, 0); (display.xlib.XSetInputFocus)( display.display, x_window.window, |