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

*.name in xresources file is differently parsed with xcb-util-xrm then xlib #66

Closed
DaveDavenport opened this issue Jun 27, 2016 · 5 comments

Comments

@DaveDavenport
Copy link

Unsure if this is a xlib not following spec or not, but setting this in RM database:

*.dpi:  133

and then requesting: rofi.dpi worked. but not when using xcb-util-xrm.

This test will show it:

diff --git a/tests/tests_match.c b/tests/tests_match.c
index 345b9ca..e9b45f8 100644
--- a/tests/tests_match.c
+++ b/tests/tests_match.c
@@ -75,6 +75,7 @@ static int test_get_resource(void) {
     err |= check_get_resource("First*?.third: 1", "First.third", "", NULL, false);
     err |= check_get_resource("First: 1", "first", "", NULL, false);
     err |= check_get_resource("First: 1", "", "first", NULL, false);
+    err |= check_get_resource("*.dpi: 133", "rofi.dpi", "rofi.dpi", "133", false);
     /* Duplicate entries */
     err |= check_get_resource(
             "First: 1\n"

results in:

== Assert that getting resource <rofi.dpi> / <rofi.dpi> returns <133>
xcb_xrm_resource_get_string() returned NULL
Returned NULL, but Xlib returned <133>

(original bug here)

@DaveDavenport
Copy link
Author

Based on this it might be invalid syntax.
*dpi: 133 seems to work.

@Airblader
Copy link
Owner

That's because the Xresources file is invalid. * and ? are not interchangable elements for matching one versus many, see the specification:

Binding     =   "." | "*"
Component   =   "?" | ComponentName

The asterisk * is actually the equivalent of ., but ? is the equivalent of a component name. In other words,

*.dpi: 133

violated the specification, the correct syntax is

*dpi: 133

@DaveDavenport DaveDavenport changed the title * in xresources file is no longer parsed with xcb-util-xrm *.name in xresources file is differently parsed with xcb-util-xrm then xlib Jun 27, 2016
@DaveDavenport
Copy link
Author

owh collision. thanks for the quick reply. Seems xlib was fuzzy with spec.

@Airblader
Copy link
Owner

Airblader commented Jun 27, 2016

Thanks for the report, though. I'm happy to see rofi adopting this library! :-)

@DaveDavenport
Copy link
Author

DaveDavenport commented Jun 27, 2016

Rofi (not its dependencies) are now xlib free 😄

Thanks for the great work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants