[PATCH] xfree86: Allow a config directory for multiple config files

Peter Hutterer peter.hutterer at who-t.net
Tue Dec 1 14:35:00 PST 2009


On Tue, Dec 01, 2009 at 06:10:58AM -0800, Dan Nicholson wrote:
> >>  /*
> >>   * prototypes for public functions
> >>   */
> >> -extern _X_EXPORT const char *xf86openConfigFile (const char *, const char *,
> >> -                                     const char *);
> >> +extern _X_EXPORT const XF86ConfPathsPtr xf86openConfigFile(const char *path,
> >> +                                                     const char *cmdline,
> >> +                                                     const char *projroot);
> >
> > is this really supposed to be public? I think this was one of the many made
> > public in 49f77fff1495c0a2050fb18f9b1fc627839bbfc2.
> 
> I don't think so, but since xf86openConfigFile was... I also don't
> think I entirely understand the _X_EXPORT/_X_INTERNAL/_X_HIDDEN rules,
> but this should only be used by the server.

if it's not used by an extension or by a driver, it should be _X_HIDDEN. Not
sure about _X_INTERNAL myself, the gcc docs say that 'internal' is "pretty
useless in real-world usage" (gcc man page)

> > Other than that, quick testing shows it works.
> >
> > Can you explain the interaction between xorg.conf and xorg.conf.d though?
> > if I read the code correctly, the xorg.conf would always be the first
> > section in the config file, thus takes precedence where the config file
> > grammar requires this. can you confirm that?
> > that should definitely go into the man page.
> 
> Yes, that's the intention. 2 things drove that decision.
> 
> 1. With AllowEmptyInput, the first InputDevice is used for the core
> devices (right?). I wanted to make sure that would remain as the first
> one in xorg.conf.

assuming AEI is _off_ (default is 'on') the first mouse/vmmouse/void/synaptics
section is used as core pointer and the first void/keyboard section is used
as core keyboard.

> 2. For InputClass, earlier sections (or backend supplied options) take
> precedence, so I again wanted to have xorg.conf trump xorg.conf.d.
> 
> Basically, I see it where packages dump config files in xorg.conf.d
> and then the admin edits xorg.conf if necessary. We can certainly
> discuss that more.
> 
> I'll resend the patch with your suggestions (and a new subject :))
> after I give it a whirl tonight. Thanks for the feedback!

[disclaimer: i haven't had time to look at the InputClass patches yet]
one of the problems with this xorg.conf.d approach is the requirement for a
ServerLayout section. e.g. in my testing of this patch yesterday, I popped a
10-touchpad.conf into xorg.conf.d but on its own it doesn't do anything. To
make it work, you'd also need a 20-serverlayout.conf that referenced the
touchpad.

IMO, that's not particularly useful, especially if we want to be able to
just throw config files in there and want them to work. It might be worth
considering a new option to be added into a InputDevice or Device section
that specifies the ServerLayout it is to be used in. Something like this:

Section "InputDevice"
        Identifier "touchpad"
        Driver "synaptics"
        Option "Layout" "any"
EndSection

of course, the InputClass patches may change this.

Cheers,
  Peter


More information about the xorg-devel mailing list