pub fn subscribe_to_event(
        &self,
        window: xproto::Window,
        mask: xproto::EventMask,
    ) -> Result<()> {
        // In xlib `XSelectInput` "lock" the display with `XLockDisplay` when setting the event
        // mask, is this needed here ?
        let attrs = xproto::ChangeWindowAttributesAux {
            event_mask: Some(mask),
            ..Default::default()
        };
        xproto::change_window_attributes(&self.conn, window, &attrs)?;
        Ok(())
    }
Subscribe to an event of a window.
display-servers/x11rb-display-server/src/xwrap/window.rs