fn send_xevent_atom(&self, window: xproto::Window, atom: xproto::Atom) -> Result<bool> {
        if self.can_send_xevent_atom(window, atom)? {
            let mut msg: xproto::ClientMessageEvent = unsafe { std::mem::zeroed() };
            msg.response_type = xproto::CLIENT_MESSAGE_EVENT;
            msg.type_ = self.atoms.WMProtocols;
            msg.window = window;
            msg.format = 32;

            let mut data = [0u32; 5];
            data[0] = atom;
            data[1] = x11rb::CURRENT_TIME;
            msg.data = data.into();

            self.send_xevent(window, false, xproto::EventMask::NO_EVENT, &msg.serialize())?;
            return Ok(true);
        }
        Ok(false)
    }
Send a xevent atom for a window to X.
display-servers/x11rb-display-server/src/xwrap.rs