pub fn grab_mouse_clicks(&self, handle: xproto::Window, is_focused: bool) -> Result<()> {
        self.ungrab_buttons(handle)?;
        if !is_focused {
            self.grab_buttons(handle, xproto::ButtonIndex::M1, xproto::ModMask::ANY)?;
            self.grab_buttons(handle, xproto::ButtonIndex::M3, xproto::ModMask::ANY)?;
        }
        let mouse_key_mask = xproto::ModMask::from(self.mouse_key_mask.bits());
        self.grab_buttons(handle, xproto::ButtonIndex::M1, mouse_key_mask)?;
        self.grab_buttons(
            handle,
            xproto::ButtonIndex::M1,
            mouse_key_mask | xproto::ModMask::SHIFT,
        )?;
        self.grab_buttons(handle, xproto::ButtonIndex::M3, mouse_key_mask)?;
        self.grab_buttons(
            handle,
            xproto::ButtonIndex::M3,
            mouse_key_mask | xproto::ModMask::SHIFT,
        )?;
        Ok(())
    }
Grabs the mouse clicks of a window.
display-servers/x11rb-display-server/src/xwrap/mouse.rs