mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-25 23:01:30 +11:00
Implement set_cursor_position() on X11
This commit is contained in:
parent
68856c3add
commit
5a31b2e438
|
@ -1485,6 +1485,10 @@ extern "C" {
|
||||||
pointer_mode: libc::c_int, keyboard_mode: libc::c_int, confine_to: Window, cursor: Cursor,
|
pointer_mode: libc::c_int, keyboard_mode: libc::c_int, confine_to: Window, cursor: Cursor,
|
||||||
time: Time) -> libc::c_int;
|
time: Time) -> libc::c_int;
|
||||||
pub fn XUngrabPointer(dpy: *mut Display, time: Time);
|
pub fn XUngrabPointer(dpy: *mut Display, time: Time);
|
||||||
|
|
||||||
|
pub fn XWarpPointer(display: *mut Display, src_w: Window, dest_w: Window, src_x: libc::c_int,
|
||||||
|
src_y: libc::c_int, src_width: libc::c_uint, src_height: libc::c_uint,
|
||||||
|
dest_x: libc::c_int, dest_y: libc::c_int);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -825,7 +825,11 @@ impl Window {
|
||||||
1.0
|
1.0
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_cursor_position(&self, _x: i32, _y: i32) -> Result<(), ()> {
|
pub fn set_cursor_position(&self, x: i32, y: i32) -> Result<(), ()> {
|
||||||
unimplemented!();
|
unsafe {
|
||||||
|
ffi::XWarpPointer(self.x.display, 0, self.x.window, 0, 0, 0, 0, x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue