summaryrefslogtreecommitdiffstats
path: root/twin/compton-tde
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-11-22 23:41:36 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-11-22 23:41:36 -0600
commit682cf1b95063acb4914109f851576a817c412c89 (patch)
tree33e3ace946ee16784105dcf2881701f11de62129 /twin/compton-tde
parentfb7b5f6d45bb29b629169fb7ecd9247435398af2 (diff)
downloadtdebase-682cf1b95063acb4914109f851576a817c412c89.tar.gz
tdebase-682cf1b95063acb4914109f851576a817c412c89.zip
Fix compton-tde not reloading settings from correct directory after user login
Diffstat (limited to 'twin/compton-tde')
-rw-r--r--twin/compton-tde/compton.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/twin/compton-tde/compton.c b/twin/compton-tde/compton.c
index 4a4d058fd..257b4c2ad 100644
--- a/twin/compton-tde/compton.c
+++ b/twin/compton-tde/compton.c
@@ -202,6 +202,12 @@ void handle_siguser (int sig)
uidnum = getuid();
}
if ((sig == SIGUSR1) || (sig == SIGUSR2)) {
+ /* force redetection of the configuration file location */
+ if (ps_g->o.config_file) {
+ free(ps_g->o.config_file);
+ ps_g->o.config_file = NULL;
+ }
+
get_cfg(ps_g, 0, 0, false); /* reload the configuration file */
/* set background/shadow picture using the new settings */
@@ -5762,6 +5768,9 @@ open_config_file(char *cpath, char **ppath) {
char *path = cpath;
FILE *f = NULL;
+ uid_t uid = getuid();
+ struct passwd *pw = getpwuid(uid);
+
if (path) {
f = fopen(path, "r");
if (f && ppath)
@@ -5800,6 +5809,27 @@ open_config_file(char *cpath, char **ppath) {
return f;
}
+ // Then check user configuration files in the system-defined home directory
+ if (pw != NULL) {
+ path = mstrjoin(pw->pw_dir, config_filename);
+ f = fopen(path, "r");
+ if (f && ppath)
+ *ppath = path;
+ else
+ free(path);
+ if (f)
+ return f;
+
+ path = mstrjoin(pw->pw_dir, config_filename_legacy);
+ f = fopen(path, "r");
+ if (f && ppath)
+ *ppath = path;
+ else
+ free(path);
+ if (f)
+ return f;
+ }
+
// Check system configuration file in $XDG_CONFIG_DIRS at last
if ((dir = getenv("XDG_CONFIG_DIRS")) && strlen(dir)) {
char *part = strtok(dir, ":");