Closed pr2502 closed 2 years ago
Now looking at src/event.rs:resolve_event
I'm pretty sure that it's not a x::StoreColors
request, that the number matching is a coincidence. Instead this issue comes from the event being from a not-loaded (possibly even not compiled-in) extension, it is unfortunate that this causes a crash.
Would you be open to making the resolve_event
functions fallible instead to allow users to handle events from disabled extensions appropriately for their application instead of crashing? I'd be happy to make a PR.
I have a simple workaround here https://github.com/pr2502/rust-xcb/commit/52a07402c136131860326fac57602b5ce70c28ac but the error should probably at least keep the suspect event code like the panic message had previously.
Hi, a window manager is a regular client and has therefore access to the same API than any other client, so you will definitely not receive requests as events.
I see in your code that you do not activate any extension.
For resolve_events
to actually resolve an extension event, you have to activate the extensions you need by using Connection::connect_with_extensions
or similar constructor. Can you try this?
The response_type == 89
indicates that this is the case. I would bet for randr
because you seem to use it, and 89 is the base_event
of randr
on my system (it should be the same for you if your server have the same X extensions than mine).
(xdpyinfo -queryExtensions
will tell you)
I agree that there is no point panicking here. Instead of an error, I would rather go for an additional Event::Unknown
that carries the original C event. It is semantically not incorrect, and I guess easier to use than an Error.
Oh thank you! I missed that I needed to enable the extensions when connecting.
I'll modify the patch for the unmatched events and make a PR for it.
fixed in #142
This occurred when running using the program as a window manager. It seems to have received the
x::StoreColors
request as an event which it then attempted and failed to parse. I'm not sure whether receiving requests as events is expected when running as a window manager or whether this is a bug earlier in the parsing and the response_type is nonsensical.The issue is reproducible for me when in version https://github.com/pr2502/mwm/tree/9498d9640f199ea6080aa11542973bfbca93763f running
./run.sh
to run a debug build in Xephyr and then opening rofi withDISPLAY=:3 rofi -show window
.Backtrace