Fix regression in executor (issue #639)

This commit is contained in:
o9000 2017-04-27 21:57:45 +02:00
parent 82776df9d6
commit e32d2342a6
3 changed files with 8 additions and 5 deletions

View file

@ -588,8 +588,10 @@ void execp_action(void *obj, int button, int x, int y, Time time)
execp->area.width, execp->area.width,
execp->area.height, execp->area.height,
command); command);
tint_exec(full_cmd, NULL, NULL, time); pid_t pid = tint_exec(full_cmd, NULL, NULL, time);
g_free(full_cmd); g_free(full_cmd);
if (pid > 0)
g_tree_insert(execp->backend->cmd_pids, GINT_TO_POINTER(pid), GINT_TO_POINTER(1));
} else { } else {
execp_force_update(execp); execp_force_update(execp);
} }

View file

@ -103,17 +103,17 @@ gboolean parse_line(const char *line, char **key, char **value)
extern char *config_path; extern char *config_path;
void tint_exec(const char *command, const char *dir, const char *tooltip, Time time) pid_t tint_exec(const char *command, const char *dir, const char *tooltip, Time time)
{ {
if (!command || strlen(command) == 0) if (!command || strlen(command) == 0)
return; return -1;
command = g_strdup_printf("export TINT2_CONFIG=%s;" command = g_strdup_printf("export TINT2_CONFIG=%s;"
"%s", "%s",
config_path, config_path,
command); command);
if (!command) if (!command)
return; return -1;
if (!tooltip) if (!tooltip)
tooltip = command; tooltip = command;
@ -160,6 +160,7 @@ void tint_exec(const char *command, const char *dir, const char *tooltip, Time t
} }
#endif // HAVE_SN #endif // HAVE_SN
} }
return pid;
} }
void tint_exec_no_sn(const char *command) void tint_exec_no_sn(const char *command)

View file

@ -54,7 +54,7 @@ void extract_values(const char *value, char **value1, char **value2, char **valu
void extract_values_4(const char *value, char **value1, char **value2, char **value3, char **value4); void extract_values_4(const char *value, char **value1, char **value2, char **value3, char **value4);
// Executes a command in a shell. // Executes a command in a shell.
void tint_exec(const char *command, const char *dir, const char *tooltip, Time time); pid_t tint_exec(const char *command, const char *dir, const char *tooltip, Time time);
void tint_exec_no_sn(const char *command); void tint_exec_no_sn(const char *command);
// Returns a copy of s in which "~" is expanded to the path to the user's home directory. // Returns a copy of s in which "~" is expanded to the path to the user's home directory.