[PATCH xorg-gtest v2 7/8] environment: remove default settings

Chase Douglas chase.douglas at canonical.com
Wed Jul 11 18:21:04 PDT 2012


On 07/11/2012 06:12 PM, Peter Hutterer wrote:
> On Wed, Jul 11, 2012 at 05:47:23PM -0700, Chase Douglas wrote:
>> On 07/11/2012 04:26 PM, Peter Hutterer wrote:
>>> On Wed, Jul 11, 2012 at 12:24:18PM -0700, Chase Douglas wrote:
>>>> On 07/10/2012 08:28 PM, Peter Hutterer wrote:
>>>>> Keep those in the server only, not the environment. And only override the
>>>>> build-in ones when they've been set by main.
>>>>
>>>> I'm a little confused by this patch. When I read "Keep those in the
>>>> server only, not the environment," I expect that the members like
>>>> path_to_conf are removed altogether from Environment::Private in
>>>> lieu of just the XServer object that is initialized properly. For
>>>> example, the constructor for the private struct would be:
>>>>
>>>> Private()
>>>> {
>>>>      server.SetOption("-config", DUMMY_CONF_PATH);
>>>>      server.SetOption("-logfile", DEFAULT_XORG_LOGFILE);
>>>>      server.SetDisplayNumber(DEFAULT_DISPLAY);
>>>> }
>>>
>>> this part isn't necessary though - the server class initialises all these
>>> defaults already. with this commit the environment can just call Start() and
>>> everything works as before.
>>>
>>> (see "xserver: store config, logfile, binary paths in the XServer object")
>>>
>>>> The second part of the commit is: "And only override the build-in
>>>> ones when they've been set by main." The code seems to remove all
>>>> the initialization of the default built-in options, so I'm not sure
>>>> what you are meaning to do here.
>>>
>>> xorg-gtest_main.cpp's main takes arguments to set the various server
>>> options. if none of them are given, Environment just calls Start(),
>>> otherwise it'll override the bits that are provided. the rest are still on
>>> the defaults.
>>
>> Ok, I see what's going on. I keep getting confused by what is an
>> environment setting vs an XServer setting. If I had to do this all
>> over again, I might have made the user create an XServer object and
>> then pass it into the Environment object. Oh well.
>
> How many direct users of the Enviroment do you have? if you're just using the
> default main() anyway we can change it to do the above.

True. We don't have any direct users. Everything we have links directly 
to libxorg-gtest_main. I'd be fine with reworking it.

-- Chase


More information about the xorg-devel mailing list