fn from_event(conn: &xcb::Connection, event: xcb::GenericEvent) -> Option<Self> {
        let button_press: &xcb::ButtonPressEvent = unsafe {
            xcb::cast_event(&event)
        };
        let child = button_press.child();

        // if button press is not on a window, we don't care
        if child == xcb::NONE {
            None
        } else {
            Some(Self {
                root_x: button_press.root_x(),
                root_y: button_press.root_y(),
                child,
                child_geom: WindowGeom::from_window_id(conn, child),
            })
        }
    }
/// Creates DragStart from a xcb event (must be a button press)
Creates DragStart from a xcb event (must be a button press)
Creates DragStart from a xcb event ( must be a button press )
fn from_event(conn: &xcb::Connection, event: xcb::GenericEvent) -> Option<Self> {
        let button_press: &xcb::ButtonPressEvent = unsafe {
            xcb::cast_event(&event)
        };
        let child = button_press.child();
        // if button press is not on a window, we don't care
        if child == xcb::NONE {
            None
        } else {
            Some(Self {
                root_x: button_press.root_x(),
                root_y: button_press.root_y(),
                child,
                child_geom: WindowGeom::from_window_id(conn, child),
            })
        }
    }
fn from_event ( conn : & xcb :: Connection , event : xcb :: GenericEvent ) -> Option < Self > { let button_press : & xcb :: ButtonPressEvent = unsafe { xcb :: cast_event ( & event ) } ; let child = button_press . child ( ) ; // if button press is not on a window, we don't care if child == xcb :: NONE { None } else { Some ( Self { root_x : button_press . root_x ( ) , root_y : button_press . root_y ( ) , child , child_geom : WindowGeom :: from_window_id ( conn , child ) , } ) } }
Creates DragStart from a xcb event (must be a button press)
Creates DragStart from a xcb event ( must be a button press )
conn
&xcb::Connection
event
xcb::GenericEvent
conn
&xcb::Connection
event
xcb::GenericEvent