aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVictor Berger <victor.berger@m4x.org>2015-12-22 14:35:55 +0100
committerVictor Berger <victor.berger@m4x.org>2015-12-22 14:36:41 +0100
commit6eba737fce8f50798d81c24eb70872ff46a2da3a (patch)
tree3ef6d710d9c549911bf00bd0f7e9df8babe2ecb4 /src
parent42551d20fdab796548e42e8699ba7d905417d257 (diff)
downloadglutin-6eba737fce8f50798d81c24eb70872ff46a2da3a.tar.gz
glutin-6eba737fce8f50798d81c24eb70872ff46a2da3a.zip
api/wayland: fix cursor errors
Diffstat (limited to 'src')
-rw-r--r--src/api/wayland/events.rs3
-rw-r--r--src/api/wayland/window.rs13
2 files changed, 11 insertions, 5 deletions
diff --git a/src/api/wayland/events.rs b/src/api/wayland/events.rs
index 8aeddac..8b18020 100644
--- a/src/api/wayland/events.rs
+++ b/src/api/wayland/events.rs
@@ -21,7 +21,8 @@ pub fn translate_event(
focuses: &mut WaylandFocuses,
known_surfaces: &HashSet<ProxyId>,
seat: Option<&WlSeat>,
-) -> Option<(GlutinEvent, ProxyId)> {
+ ) -> Option<(GlutinEvent, ProxyId)>
+{
let WaylandEvent::Wayland(wayland_evt) = evt;
match wayland_evt {
WPE::WlSeat(_, seat_evt) => match seat_evt {
diff --git a/src/api/wayland/window.rs b/src/api/wayland/window.rs
index a9285fa..0005a83 100644
--- a/src/api/wayland/window.rs
+++ b/src/api/wayland/window.rs
@@ -298,9 +298,14 @@ impl Window {
}
#[inline]
- pub fn set_cursor_state(&self, _state: CursorState) -> Result<(), String> {
- // TODO
- Ok(())
+ pub fn set_cursor_state(&self, state: CursorState) -> Result<(), String> {
+ use CursorState::{Grab, Normal, Hide};
+ // 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]
@@ -311,7 +316,7 @@ impl Window {
#[inline]
pub fn set_cursor_position(&self, _x: i32, _y: i32) -> Result<(), ()> {
// TODO: not yet possible on wayland
- Ok(())
+ Err(())
}
#[inline]