diff --git a/WINGs/wevent_wl.c b/WINGs/wevent_wl.c index b1e438c..f2d5822 100644 --- a/WINGs/wevent_wl.c +++ b/WINGs/wevent_wl.c @@ -377,8 +377,14 @@ static void wl_keysym_convert_case(void *ectx, WMNativeKeysym sym, static void wl_send_wm_command(void *ectx, const char *cmd) { (void)ectx; - if (cmd && strcmp(cmd, "Reconfigure") == 0) - kill(getppid(), SIGUSR2); + if (cmd && strcmp(cmd, "Reconfigure") == 0) { + const char *pidstr = getenv("WMAKER_PID"); + if (pidstr) { + pid_t pid = (pid_t)atoi(pidstr); + if (pid > 0) + kill(pid, SIGUSR2); + } + } } static void wl_set_window_hints(void *ectx, WNativeWindow w, diff --git a/src/main.c b/src/main.c index abccfda..36143a2 100644 --- a/src/main.c +++ b/src/main.c @@ -622,6 +622,11 @@ static int real_main(int argc, char **argv) /* for telling WPrefs what's the name of the wmaker binary being ran */ setenv("WMAKER_BIN_NAME", argv[0], 1); + { + char pidbuf[16]; + snprintf(pidbuf, sizeof(pidbuf), "%d", (int)getpid()); + setenv("WMAKER_PID", pidbuf, 1); + } ArgCount = argc; Arguments = wmalloc(sizeof(char *) * (ArgCount + 1));