(This shouldn't be a problem for servers using the XFree86-based keyboard
DDX'es, since it calls XkbSetRulesDflts to set XkbRulesFile, but can cause
problems for some of the other servers. I found it while debugging the Xsun
XkbWriteRulesProp calculates how long of a string it needs to allocate,
allocates the string and fills it in, but then aborts if it didn't fill in
the same length it calculated.
When calculating how much room to allocate it checks to see if XkbRulesFile
is NULL. If it's not, it uses the length of it, otherwise it uses the length
of the XKB_DFLT_RULES_FILE #define'd string.
When filling in the string however, if XkbRulesFile is NULL, it doesn't copy
in any text for the rules entry, thus causing the string lengths to mismatch
and the _XKB_RULES_NAMES property will not be set on the root window.
Adding a simple else clause to fill in the rules value with the string from
XKB_DFLT_RULES_FILE allows the function to work properly and the property is
[Also reported to XFree86 bugzilla #1115]
Created attachment 167 [details] [review]
Patch to xc/programs/Xserver/xkb/xkbInit.c
Module name: xc
Changes by: alanc@pdx. 04/03/26 09:11:49
29. XkbWriteRulesProp fails if XkbRulesFile is NULL. Bug #376.
./: Tag: XORG-CURRENT
xc/programs/Xserver/xkb/: Tag: XORG-CURRENT
Revision Changes Path
188.8.131.52 +3 -1 xc/Attic/CHANGELOG-CURRENT
184.108.40.206 +4 -0 xc/programs/Xserver/xkb/xkbInit.c