mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-23 22:01:31 +11:00
make x11 keyboard repeat detectable
This commit is contained in:
parent
485e89715f
commit
bcd3da1fcd
|
@ -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 );
|
||||
|
||||
*/
|
||||
*/
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue