Bug 192484 - kgamma doesn't write to xorg.conf
Summary: kgamma doesn't write to xorg.conf
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_kgamma (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-12 22:23 UTC by Werner Lemberg
Modified: 2009-05-13 18:43 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Simple proposed patch (395 bytes, patch)
2009-05-13 17:05 UTC, Dario Andres
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Werner Lemberg 2009-05-12 22:23:02 UTC
Version:            (using KDE 4.2.3)
OS:                Linux
Installed from:    SuSE RPMs

kgamma only modifies XF86Config if asked to do so but not xorg.conf.
Recent X11 versions, however, only use xorg.conf, AFAIK; this means that
global gamma settings are never applied.

I suggest that kgamma writes to both files.

[SaX, openSuSE's X11 configuration tool, creates both XF86Config and
xorg.conf]
Comment 1 Dario Andres 2009-05-12 22:43:26 UTC
Currently it uses the following order:

    searchPaths.push_back("/etc/X11/XF86Config-4");
    searchPaths.push_back("/etc/X11/XF86Config");
    searchPaths.push_back("/etc/XF86Config");
    searchPaths.push_back("/usr/X11R6/etc/X11/XF86Config-4");
    searchPaths.push_back("/usr/X11R6/etc/X11/XF86Config");
    searchPaths.push_back("/usr/X11R6/lib/X11/XF86Config-4");
    searchPaths.push_back("/usr/X11R6/lib/X11/XF86Config");
    searchPaths.push_back("/etc/X11/xorg.conf-4");
    searchPaths.push_back("/etc/X11/xorg.conf");
    searchPaths.push_back("/etc/xorg.conf");
    searchPaths.push_back("/usr/X11R6/etc/X11/xorg.conf-4");
    searchPaths.push_back("/usr/X11R6/etc/X11/xorg.conf");
    searchPaths.push_back("/usr/X11R6/lib/X11/xorg.conf-4");
    searchPaths.push_back("/usr/X11R6/lib/X11/xorg.conf");

And when it finds one it changes it and it stop. So, it's finding "XF86Config" first and then not applying the changes to "xorg.conf".

Do you know why do you have the "XF86Config" if it is deprecated? Does OpenSUSE creates/modify both of them ?

Thanks
Comment 2 Werner Lemberg 2009-05-12 22:58:31 UTC
Yes, as mentioned in the description: SaX creates (and modifies) both xorg.conf and XF86Config – both files have the same creation date (within a comment in
the file).
Comment 3 Dario Andres 2009-05-13 17:05:01 UTC
Created attachment 33611 [details]
Simple proposed patch

Don't stop modifying the config files when we found one. There could be more of them.
(I wonder if we also should change the order of the files as "xorg.conf" is now more common that "XF86Config"
Comment 4 Werner Lemberg 2009-05-13 17:10:27 UTC
Well, AFAIK, the current X11 git repositories use xorg.conf, so I suspect
that this config file name will become predominant.

Thanks for the fix.  Hopefully, this gets soon integrated into openSuSE's
KDE repository.
Comment 5 Dario Andres 2009-05-13 18:38:17 UTC
The patch doesn't work as expect. I will commit another patch, to search first for the xorg.conf file as they are more common now, and some systems may have both of the (but xorg.conf is the only used actually)
Comment 6 Dario Andres 2009-05-13 18:41:50 UTC
SVN commit 967638 by darioandres:

When updating the gamma values, first search for the "xorg.conf" file
which is the default config file in this moment. Then, fallback to
"XF86Config"
This solves an issue on some distributions as OpenSUSE which creates both
xorg.conf and XF86Config. And the gamma values were only applied to XF86Config
which is not used.

BUG: 192484


 M  +10 -8     xf86gammacfg.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=967638
Comment 7 Dario Andres 2009-05-13 18:43:55 UTC
SVN commit 967639 by darioandres:

Backport to 4.2branch of:
SVN commit 967638 by darioandres:

When updating the gamma values, first search for the "xorg.conf" file
which is the default config file in this moment. Then, fallback to
"XF86Config"
This solves an issue on some distributions as OpenSUSE which creates both
xorg.conf and XF86Config. And the gamma values were only applied to XF86Config
which is not used.

CCBUG: 192484



 M  +10 -8     xf86gammacfg.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=967639