pub fn close_window(&self, window_id: &WindowId) {
        let has_wm_delete_window = self
            .get_wm_protocols(window_id)
            .map(|protocols| protocols.contains(&self.atoms.WM_DELETE_WINDOW))
            .unwrap_or(false);

        if has_wm_delete_window {
            info!("Closing window {} using WM_DELETE", window_id);
            let data = xcb::ClientMessageData::from_data32([
                self.atoms.WM_DELETE_WINDOW,
                xcb::CURRENT_TIME,
                0,
                0,
                0,
            ]);
            let event =
                xcb::ClientMessageEvent::new(32, window_id.to_x(), self.atoms.WM_PROTOCOLS, data);
            xcb::send_event(
                &self.conn,
                false,
                window_id.to_x(),
                xcb::EVENT_MASK_NO_EVENT,
                &event,
            );
        } else {
            info!("Closing window {} using xcb::destroy_window()", window_id);
            xcb::destroy_window(&self.conn, window_id.to_x());
        }
    }
/// Closes a window.
///
/// The window will be closed gracefully using the ICCCM WM_DELETE_WINDOW
/// protocol if it is supported.
Closes a window.
The window will be closed gracefully using the ICCCM WM_DELETE_WINDOW
protocol if it is supported.
Closes a window . The window will be closed gracefully using the ICCCM WM_DELETE_WINDOW protocol if it is supported .
pub fn close_window(&self, window_id: &WindowId) {
        let has_wm_delete_window = self
            .get_wm_protocols(window_id)
            .map(|protocols| protocols.contains(&self.atoms.WM_DELETE_WINDOW))
            .unwrap_or(false);
        if has_wm_delete_window {
            info!("Closing window {} using WM_DELETE", window_id);
            let data = xcb::ClientMessageData::from_data32([
                self.atoms.WM_DELETE_WINDOW,
                xcb::CURRENT_TIME,
                0,
                0,
                0,
            ]);
            let event =
                xcb::ClientMessageEvent::new(32, window_id.to_x(), self.atoms.WM_PROTOCOLS, data);
            xcb::send_event(
                &self.conn,
                false,
                window_id.to_x(),
                xcb::EVENT_MASK_NO_EVENT,
                &event,
            );
        } else {
            info!("Closing window {} using xcb::destroy_window()", window_id);
            xcb::destroy_window(&self.conn, window_id.to_x());
        }
    }
pub fn close_window ( & self , window_id : & WindowId ) { let has_wm_delete_window = self . get_wm_protocols ( window_id ) . map ( | protocols | protocols . contains ( & self . atoms . WM_DELETE_WINDOW ) ) . unwrap_or ( false ) ; if has_wm_delete_window { info ! ( " " window_id ) ; let data = xcb :: ClientMessageData :: from_data32 ( [ self . atoms . WM_DELETE_WINDOW , xcb :: CURRENT_TIME , 0 , 0 , 0 , ] ) ; let event = xcb :: ClientMessageEvent :: new ( 32 , window_id . to_x ( ) , self . atoms . WM_PROTOCOLS , data ) ; xcb :: send_event ( & self . conn , false , window_id . to_x ( ) , xcb :: EVENT_MASK_NO_EVENT , & event , ) ; } else { info ! ( " " window_id ) ; xcb :: destroy_window ( & self . conn , window_id . to_x ( ) ) ; } }
Closes a window.
Closes a window .
&self
window_id
&WindowId