mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 22:31:30 +11:00
api/wayland: fix cursor errors
This commit is contained in:
parent
42551d20fd
commit
6eba737fce
|
@ -21,7 +21,8 @@ pub fn translate_event(
|
||||||
focuses: &mut WaylandFocuses,
|
focuses: &mut WaylandFocuses,
|
||||||
known_surfaces: &HashSet<ProxyId>,
|
known_surfaces: &HashSet<ProxyId>,
|
||||||
seat: Option<&WlSeat>,
|
seat: Option<&WlSeat>,
|
||||||
) -> Option<(GlutinEvent, ProxyId)> {
|
) -> Option<(GlutinEvent, ProxyId)>
|
||||||
|
{
|
||||||
let WaylandEvent::Wayland(wayland_evt) = evt;
|
let WaylandEvent::Wayland(wayland_evt) = evt;
|
||||||
match wayland_evt {
|
match wayland_evt {
|
||||||
WPE::WlSeat(_, seat_evt) => match seat_evt {
|
WPE::WlSeat(_, seat_evt) => match seat_evt {
|
||||||
|
|
|
@ -298,9 +298,14 @@ impl Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn set_cursor_state(&self, _state: CursorState) -> Result<(), String> {
|
pub fn set_cursor_state(&self, state: CursorState) -> Result<(), String> {
|
||||||
// TODO
|
use CursorState::{Grab, Normal, Hide};
|
||||||
Ok(())
|
// TODO : not yet possible on wayland to grab cursor
|
||||||
|
match state {
|
||||||
|
Grab => Err("Cursor cannot be grabbed on wayland yet.".to_string()),
|
||||||
|
Hide => Err("Cursor cannot be hidden on wayland yet.".to_string()),
|
||||||
|
Normal => Ok(())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -311,7 +316,7 @@ impl Window {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn set_cursor_position(&self, _x: i32, _y: i32) -> Result<(), ()> {
|
pub fn set_cursor_position(&self, _x: i32, _y: i32) -> Result<(), ()> {
|
||||||
// TODO: not yet possible on wayland
|
// TODO: not yet possible on wayland
|
||||||
Ok(())
|
Err(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
Loading…
Reference in a new issue