diff --git a/src/wayland/seat/mod.rs b/src/wayland/seat/mod.rs index 2e534da..b52fe88 100644 --- a/src/wayland/seat/mod.rs +++ b/src/wayland/seat/mod.rs @@ -103,7 +103,7 @@ impl Inner { /// This struct gives you access to the control of the /// capabilities of the associated seat. /// -/// It is directly inserted in the event loop by its [`new`](Seat::new) method. +/// It is directly inserted in the wayland display by its [`new`](Seat::new) method. /// /// This is an handle to the inner logic, it can be cloned. /// @@ -117,7 +117,7 @@ impl Seat { /// Create a new seat global /// /// A new seat global is created with given name and inserted - /// into this event loop. + /// into this wayland display. /// /// You are provided with the state token to retrieve it (allowing /// you to add or remove capabilities from it), and the global handle, @@ -176,8 +176,8 @@ impl Seat { /// will overwrite it, and will be seen by the clients as if the /// mouse was unplugged and a new one was plugged. /// - /// You need to provide a compositor token, as well as a callback that will be notified - /// whenever a client requests to set a custom cursor image. + /// You need to provide a callback that will be notified whenever a client requests + /// to set a custom cursor image. /// /// # Examples /// @@ -193,7 +193,7 @@ impl Seat { /// # None /// # ); /// let pointer_handle = seat.add_pointer( - /// |new_status| { /* a closure handling requests from clients tot change the cursor icon */ } + /// |new_status| { /* a closure handling requests from clients to change the cursor icon */ } /// ); /// ``` pub fn add_pointer(&mut self, cb: F) -> PointerHandle diff --git a/src/wayland/seat/pointer.rs b/src/wayland/seat/pointer.rs index c6ba459..3e13159 100644 --- a/src/wayland/seat/pointer.rs +++ b/src/wayland/seat/pointer.rs @@ -74,25 +74,10 @@ impl fmt::Debug for PointerInternal { } impl PointerInternal { - fn new(mut cb: F) -> PointerInternal + fn new(cb: F) -> PointerInternal where F: FnMut(CursorImageStatus) + 'static, { - let mut old_status = CursorImageStatus::Default; - let wrapper = move |new_status: CursorImageStatus| { - if let CursorImageStatus::Image(surface) = - ::std::mem::replace(&mut old_status, new_status.clone()) - { - match new_status { - CursorImageStatus::Image(ref new_surface) if new_surface == &surface => { - // don't remove the role, we are just re-binding the same surface - } - _ => {} - } - } - cb(new_status) - }; - PointerInternal { known_pointers: Vec::new(), focus: None, @@ -100,7 +85,7 @@ impl PointerInternal { location: (0.0, 0.0), grab: GrabStatus::None, pressed_buttons: Vec::new(), - image_callback: Box::new(wrapper) as Box<_>, + image_callback: Box::new(cb) as Box<_>, } }