Skip to content
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

Add visual IDs to X11 handles #83

Merged
merged 1 commit into from Dec 3, 2021
Merged

Conversation

Ralith
Copy link
Contributor

@Ralith Ralith commented Dec 2, 2021

Needed for Vulkan physical device presentation support queries (e.g. vkGetPhysicalDeviceXlibPresentationSupportKHR).

I'm not sure what, if anything, would be a sensible default value for these that won't cause fallout if someone tries to use it. Do we try to solve that problem in general?

@Lokathor
Copy link
Contributor

Lokathor commented Dec 2, 2021

If 0 is generally "invalid" then that's fine as the default.

@Ralith
Copy link
Contributor Author

Ralith commented Dec 2, 2021

That doesn't seem to be documented either way, though empirically it seems to hold (see xdpyinfo) and https://github.com/mirror/libX11/blob/5faa8dc0b364f55f19034c370436074646d9ad54/src/GetRGBCMap.c#L54 suggests it's sensible.

@madsmtm
Copy link
Member

madsmtm commented Dec 2, 2021

You could perhaps submit a patch to their documentation, saying that a visual ID that is None / zero is indeed invalid? E.g. add it to the Visual Types part of their specification.

And here, mentioning that If the visualid is not present means the visualid is None.

@Ralith
Copy link
Contributor Author

Ralith commented Dec 2, 2021

I don't think I have the energy to work out the contribution process for Xlib.

And here, mentioning that If the visualid is not present means the visualid is None.

Where is that meaning specified?

https://xcb.freedesktop.org/xlibtoxcbtranslationguide/ does also seem to use 0 as a sentinel.

@Lokathor
Copy link
Contributor

Lokathor commented Dec 2, 2021

@Ralith how about just expanding the doc comments a bit on our end. Just add a line that says "the current default is 0, which seems to be the standard sentinel for a missing value of this type" or something like that.

@madsmtm
Copy link
Member

madsmtm commented Dec 2, 2021

I don't think I have the energy to work out the contribution process for Xlib.

Yeah, me neither, I was hoping you might already be involved.

Where is that meaning specified?

Sorry, I meant you (or a person contributing to the documentation) would update the docs there too, to specify what "not present" means.

expanding the doc comments a bit on our end

Fine by me.

Needed for Vulkan physical device presentation support queries.
@Ralith
Copy link
Contributor Author

Ralith commented Dec 3, 2021

How's this?

@Lokathor
Copy link
Contributor

Lokathor commented Dec 3, 2021

excellent.

@Lokathor Lokathor merged commit 65f518e into rust-windowing:master Dec 3, 2021
@Ralith Ralith deleted the visual-id branch March 29, 2022 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants