pub fn motion(
        &mut self,
        location: Point<f64, Logical>,
        focus: Option<(WlSurface, Point<i32, Logical>)>,
        serial: Serial,
        time: u32,
    ) {
        // do we leave a surface ?
        let mut leave = true;
        self.inner.location = location;
        if let Some((ref current_focus, _)) = self.inner.focus {
            if let Some((ref surface, _)) = focus {
                if current_focus.as_ref().equals(surface.as_ref()) {
                    leave = false;
                }
            }
        }
        if leave {
            self.inner.with_focused_pointers(|pointer, surface| {
                pointer.leave(serial.into(), surface);
                if pointer.as_ref().version() >= 5 {
                    pointer.frame();
                }
            });
            self.inner.focus = None;
            (self.inner.image_callback)(CursorImageStatus::Default);
        }

        // do we enter one ?
        if let Some((surface, surface_location)) = focus {
            let entered = self.inner.focus.is_none();
            // in all cases, update the focus, the coordinates of the surface
            // might have changed
            self.inner.focus = Some((surface, surface_location));
            let (x, y) = (location - surface_location.to_f64()).into();
            if entered {
                self.inner.with_focused_pointers(|pointer, surface| {
                    pointer.enter(serial.into(), surface, x, y);
                    if pointer.as_ref().version() >= 5 {
                        pointer.frame();
                    }
                })
            } else {
                // we were on top of a surface and remained on it
                self.inner.with_focused_pointers(|pointer, _| {
                    pointer.motion(time, x, y);
                    if pointer.as_ref().version() >= 5 {
                        pointer.frame();
                    }
                })
            }
        }
    }
/// Notify that the pointer moved
///
/// You provide the new location of the pointer, in the form of:
///
/// - The coordinates of the pointer in the global compositor space
/// - The surface on top of which the cursor is, and the coordinates of its
///   origin in the global compositor space (or `None` of the pointer is not
///   on top of a client surface).
///
/// This will internally take care of notifying the appropriate client objects
/// of enter/motion/leave events.
Notify that the pointer moved
You provide the new location of the pointer, in the form of.

The coordinates of the pointer in the global compositor space
The surface on top of which the cursor is, and the coordinates of its
origin in the global compositor space (or `None` of the pointer is not
on top of a client surface).

This will internally take care of notifying the appropriate client objects
of enter/motion/leave events.
Notify that the pointer moved You provide the new location of the pointer in the form of . The coordinates of the pointer in the global compositor space The surface on top of which the cursor is and the coordinates of its origin in the global compositor space ( or ` None ` of the pointer is not on top of a client surface ) . This will internally take care of notifying the appropriate client objects of enter / motion / leave events .
pub fn motion(
        &mut self,
        location: Point<f64, Logical>,
        focus: Option<(WlSurface, Point<i32, Logical>)>,
        serial: Serial,
        time: u32,
    ) {
        // do we leave a surface ?
        let mut leave = true;
        self.inner.location = location;
        if let Some((ref current_focus, _)) = self.inner.focus {
            if let Some((ref surface, _)) = focus {
                if current_focus.as_ref().equals(surface.as_ref()) {
                    leave = false;
                }
            }
        }
        if leave {
            self.inner.with_focused_pointers(|pointer, surface| {
                pointer.leave(serial.into(), surface);
                if pointer.as_ref().version() >= 5 {
                    pointer.frame();
                }
            });
            self.inner.focus = None;
            (self.inner.image_callback)(CursorImageStatus::Default);
        }
        // do we enter one ?
        if let Some((surface, surface_location)) = focus {
            let entered = self.inner.focus.is_none();
            // in all cases, update the focus, the coordinates of the surface
            // might have changed
            self.inner.focus = Some((surface, surface_location));
            let (x, y) = (location - surface_location.to_f64()).into();
            if entered {
                self.inner.with_focused_pointers(|pointer, surface| {
                    pointer.enter(serial.into(), surface, x, y);
                    if pointer.as_ref().version() >= 5 {
                        pointer.frame();
                    }
                })
            } else {
                // we were on top of a surface and remained on it
                self.inner.with_focused_pointers(|pointer, _| {
                    pointer.motion(time, x, y);
                    if pointer.as_ref().version() >= 5 {
                        pointer.frame();
                    }
                })
            }
        }
    }
pub fn motion ( & mut self , location : Point < f64 , Logical > , focus : Option < ( WlSurface , Point < i32 , Logical > ) > , serial : Serial , time : u32 , ) { // do we leave a surface ? let mut leave = true ; self . inner . location = location ; if let Some ( ( ref current_focus , _ ) ) = self . inner . focus { if let Some ( ( ref surface , _ ) ) = focus { if current_focus . as_ref ( ) . equals ( surface . as_ref ( ) ) { leave = false ; } } } if leave { self . inner . with_focused_pointers ( | pointer , surface | { pointer . leave ( serial . into ( ) , surface ) ; if pointer . as_ref ( ) . version ( ) >= 5 { pointer . frame ( ) ; } } ) ; self . inner . focus = None ; ( self . inner . image_callback ) ( CursorImageStatus :: Default ) ; } // do we enter one ? if let Some ( ( surface , surface_location ) ) = focus { let entered = self . inner . focus . is_none ( ) ; // in all cases, update the focus, the coordinates of the surface // might have changed self . inner . focus = Some ( ( surface , surface_location ) ) ; let ( x , y ) = ( location - surface_location . to_f64 ( ) ) . into ( ) ; if entered { self . inner . with_focused_pointers ( | pointer , surface | { pointer . enter ( serial . into ( ) , surface , x , y ) ; if pointer . as_ref ( ) . version ( ) >= 5 { pointer . frame ( ) ; } } ) } else { // we were on top of a surface and remained on it self . inner . with_focused_pointers ( | pointer , _ | { pointer . motion ( time , x , y ) ; if pointer . as_ref ( ) . version ( ) >= 5 { pointer . frame ( ) ; } } ) } } }
Notify that the pointer moved
You provide the new location of the pointer, in the form of:
Notify that the pointer moved You provide the new location of the pointer in the form of :
&mut self
location
Point<f64, Logical>
focus
Option<(WlSurface, Point<i32, Logical>)>
serial
Serial
time
u32
&mut self
location
Point<f64, Logical>
focus
Option<(WlSurface, Point<i32, Logical>)>
serial
Serial
time
u32