Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add structure-based request-sending API #212

Closed
psychon opened this issue Feb 22, 2020 · 1 comment
Closed

Add structure-based request-sending API #212

psychon opened this issue Feb 22, 2020 · 1 comment
Labels
P5 Priority Nice-to-have

Comments

@psychon
Copy link
Owner

psychon commented Feb 22, 2020

Idea originally by @eduardosm. See #211 (comment).

Basically:

https://github.com/eduardosm/rust-xcbalt/blob/974b76a5e2e776f87a06fa0abc9fd0d3962696b3/examples/xi2_events.rs#L10-L36

Why would one want something like this? According to clippy, some functions already have too many arguments: https://github.com/psychon/x11rb/blob/1e6289fb7ef20041038b8fca440520bd731aedac/code_generator_helpers/module.py#L181

Let's also look at a random create_window call:

conn.create_window(screen.root_depth, win_id, screen.root, 0, 0, width, height, 0, WindowClass::InputOutput, 0, &win_aux).unwrap();

No idea what all of the 0 arguments are. Uhm.. there is border_width. I think that comes after width and height. Besides that, no idea. After having taken a look: Oh, I could have thought of x/y, but didn't. The last 0 is visual and 0 just happens to be the value for COPY_FROM_PARENT.

Anyway, the point is: This stuff is currently hard to understand.

The idea with this issue is not to replace the already existing API, but add a new alternative to it (perhaps behind some Cargo feature).

@psychon
Copy link
Owner Author

psychon commented Jun 21, 2020

Implemented by #499

@psychon psychon closed this as completed Jun 21, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
P5 Priority Nice-to-have
Projects
None yet
Development

No branches or pull requests

1 participant