Description: TODO: Put a short summary on the line above and replace this paragraph with a longer explanation of this change. Complete the meta-information with other relevant fields (see below for details). To make it easier, the information below has been extracted from the changelog. Adjust it or drop it. . mate-xfce4-panel-plugin-loader-applet (1.1.1-1~webupd8~wily01) wily; urgency=medium . * initial debianization Author: Alin Andrei --- The information above should follow the Patch Tagging Guidelines, please checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here are templates for supplementary fields that you might want to add: Origin: , Bug: Bug-Debian: https://bugs.debian.org/ Bug-Ubuntu: https://launchpad.net/bugs/ Forwarded: Reviewed-By: Last-Update: --- mate-xfce4-panel-plugin-loader-applet-1.1.1.orig/src/mate-xfce4-panel-plugin-loader-applet.c +++ mate-xfce4-panel-plugin-loader-applet-1.1.1/src/mate-xfce4-panel-plugin-loader-applet.c @@ -465,9 +465,31 @@ static FILE *open_proc_environ(const cha closedir(dirp); return NULL; } + + +static FILE *open_proc_environ_mate() +{ + char line[32]; + FILE *cmd = popen("pgrep -n mate-panel", "r"); + fgets(line, 32, cmd); + pid_t pid = strtoul(line, NULL, 10); + if (pid!=0) + { + char pth[32]; + snprintf(pth, sizeof pth, "/proc/%d/environ", pid); + return fopen(pth,"rb"); + } + + return NULL; + + + +} + static void set_environmental_variables_from_mate_panel() { - FILE *f = open_proc_environ("mate-panel"); + //FILE *f = open_proc_environ("mate-panel"); + FILE *f = open_proc_environ_mate(); if (f) { int env_buff_size = 0, env_buff_pos = 0;