Branch: master

682cf1b9 2014-11-22 23:41:36 Timothy Pearson
Fix compton-tde not reloading settings from correct directory after user login
M twin/compton-tde/compton.c
diff --git a/twin/compton-tde/compton.c b/twin/compton-tde/compton.c
index 4a4d058..257b4c2 100644
--- a/twin/compton-tde/compton.c
+++ b/twin/compton-tde/compton.c
@@ -202,6 +202,12 @@
         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 @@
   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 @@
       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, ":");
534a069e 2014-11-22 23:42:12 Timothy Pearson
Merge branch 'master' of https://scm.trinitydesktop.org/scm/git/tdebase
M twin/compton-tde/common.h
diff --git a/twin/compton-tde/common.h b/twin/compton-tde/common.h
index ddb00fa..759e646 100644
--- a/twin/compton-tde/common.h
+++ b/twin/compton-tde/common.h
@@ -493,7 +493,7 @@
   /// Framebuffer used for greyscale conversion.
   GLuint fbo;
   /// Textures used for greyscale conversion.
-  GLuint textures[2];
+  GLuint textures[1];
   /// Width of the textures.
   int width;
   /// Height of the textures.