-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
event_mask argument to xproto's GrabButton is smaller than the corresponding bitmask #543
Comments
Are there any plans to fix this? What will it take to fix this? I can try to help. |
Well....
In general: Yes. But I do not know how to (easily) fix this.
I'm not sure. I guess "a good idea on how to fix this". A random idea would be to go the #369 route and deviate from upstream's XML (since I doubt that this could be fixed upstream in a backwards compatible way). Or do "something special" in the code generator. This is basically the same idea as the previous point, just implemented in a different way. Even ignoring the "how?" (which is what I thought about in the last two points), there is also the "what?": How should the generated code for this look like? What's the best fix that doesn't cause problems down the road. E.g. adding other event enums means that users might now expect a way to convert between these enums.... So, do sum it up: I'm not really sure |
So, I'm confused. Is the reason event mask 16 bit despite it having the ability to have more values because for GrabButton, there aren't more values required? There are many places in the xml where the event mask is used with 32 bits instead. Do you think it is possible to generate separate event masks based on what's making the request? My understanding is that GrabButton requires only a subset of EventMask so maybe the enum needed for GrabButton only needs to contain those values? |
According to the protocol manual ( https://www.x.org/releases/X11R7.6/doc/xproto/x11protocol.html ), the one event mask that xcb-proto / xcb has really should be three separate ones:
"DEVICEEVENT" only appears in the Searching for "pointerevents", it seems like this enum is for grab-related things (e.g. So, both of these would fit into a 16 bit number. Thus, yeah, this really should be three different enums, I guess. |
Do you know where these enums are generated in the code? Do you think we can make a special case for EventMask and just hard code 3 different enums? Or is there a better way to do this? I don't know if there's a more general solution to deal with other places such an issue may occur. |
Hopefully this is the only place where this occurs. I guess the easiest way to fix this is to do what #369 suggests and just patch our XML. Anyway, the code for an
The Rust x11rb/generator/src/generator/namespace/mod.rs Lines 673 to 711 in 2fd40af
The rest of the function seems to emit |
See #542:
xproto's
GrabButton
request has this field:x11rb/xcb-proto-1.14-1-g2b3559c/src/xproto.xml
Line 2743 in a29b84d
This is a 16 bit field, but refers to an enum that has 24 bit values. Thus, the enum does not implement
Into<u16>
in x11rb and the API requires manual casts. It would be nice if we could do something about that.Edit:
Looking at the protocol manual, it seems like all of the following are represented by
EventMask
in XCB, but are actually different in the protocol docs:The text was updated successfully, but these errors were encountered: