I'm having trouble with getting the _NET_ACTIVE_WINDOW atom right after X is started.
Most likely it's due to the fact that at that time the atom is not set.
Xcb doesn't returns an error and instead returns an invalid reply.
After that the bogus reply is passed to this from function.
It looks like this should be a problem with other atoms but I didn't try.
I think this should be fixed in the caller (wait_for_reply and wait_for_reply_unchecked) by checking if the returned reply has 0 length.
Something like this:
pub fn wait_for_reply<C>(&self, cookie: C) -> xcb::Result<C::Reply>
where
C: EwmhPropertyCookieChecked,
{
let xcb_reply = self.con.wait_for_reply(cookie.inner());
match xcb_reply{
Ok(reply) => {
if reply.length() == 0{
return Err(/*not sure which error to use here*/)
}
else{
Ok(reply.into())
}
},
Err(e) => Err(e),
}
}
I'm having trouble with getting the
_NET_ACTIVE_WINDOW
atom right after X is started. Most likely it's due to the fact that at that time the atom is not set. Xcb doesn't returns an error and instead returns an invalid reply. After that the bogus reply is passed to thisfrom
function.reply.value::<u32>()
returns an empty slice so indexing it panics.This is what a bad reply looks like:
Trying to debug print reply blows up with this scary error
It looks like this should be a problem with other atoms but I didn't try. I think this should be fixed in the caller (
wait_for_reply
andwait_for_reply_unchecked
) by checking if the returned reply has 0 length. Something like this: