mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 06:11:30 +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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -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