Merge pull request #35 from evant/master

Make x11 keyboard repeat detectable
This commit is contained in:
tomaka 2014-09-16 07:53:20 +02:00
commit 1ae81267f5
2 changed files with 13 additions and 1 deletions

View file

@ -1406,6 +1406,8 @@ extern "C" {
pub fn glXMakeCurrent(dpy: *mut Display, drawable: GLXDrawable,
ctx: GLXContext) -> Bool;
pub fn glXSwapBuffers(dpy: *mut Display, drawable: GLXDrawable);
pub fn XkbSetDetectableAutoRepeat(dpy: *mut Display, detectable: bool, supported_rtm: *mut bool) -> bool;
}
/*
@ -1462,4 +1464,4 @@ extern const char *glXGetClientString( Display *dpy, int name );
extern Display *glXGetCurrentDisplay( void );
*/
*/

View file

@ -179,6 +179,16 @@ impl Window {
ic
};
// Attempt to make keyboard input repeat detectable
unsafe {
let mut supported_ptr = false;
ffi::XkbSetDetectableAutoRepeat(display, true, &mut supported_ptr);
if !supported_ptr {
return Err(format!("XkbSetDetectableAutoRepeat failed"));
}
}
// creating GL context
let context = unsafe {
let mut attributes = Vec::new();