changed script_run back to bool

This commit is contained in:
Djeeberjr 2020-07-18 15:51:04 +02:00
parent 4d66a60a4f
commit 1b8f56eb45
3 changed files with 7 additions and 10 deletions

View File

@ -102,6 +102,11 @@ void notification_print(const struct notification *n)
/* see notification.h */
void notification_run_script(struct notification *n)
{
if (n->script_run && !settings.always_run_script)
return;
n->script_run = true;
const char *appname = n->appname ? n->appname : "";
const char *summary = n->summary ? n->summary : "";
const char *body = n->body ? n->body : "";
@ -111,16 +116,11 @@ void notification_run_script(struct notification *n)
for(int i = 0; i < n->script_count; i++) {
if(n->script_run[i] && !settings.always_run_script)
continue;
const char *script = n->scripts[i];
if (STR_EMPTY(script))
continue;
n->script_run[i] = true;
int pid1 = fork();
if (pid1) {
@ -250,7 +250,6 @@ void notification_unref(struct notification *n)
if (n->script_count > 0){
g_free(n->scripts);
g_free(n->script_run);
}
g_free(n);
@ -334,6 +333,7 @@ struct notification *notification_create(void)
n->transient = false;
n->progress = -1;
n->script_run = false;
n->dbus_valid = false;
n->fullscreen = FS_SHOW;

View File

@ -80,7 +80,7 @@ struct notification {
int dup_count; /**< amount of duplicate notifications stacked onto this */
int displayed_height;
enum behavior_fullscreen fullscreen; //!< The instruction what to do with it, when desktop enters fullscreen
bool *script_run; /**< Has the script been executed already? */
bool script_run; /**< Has the script been executed already? */
/* derived fields */
char *msg; /**< formatted message */

View File

@ -48,9 +48,6 @@ void rule_apply(struct rule *r, struct notification *n)
n->scripts = g_renew(const char*,n->scripts,n->script_count + 1);
n->scripts[n->script_count] = r->script;
n->script_run = g_renew(bool,n->script_run,n->script_count + 1);
n->script_run[n->script_count] = false;
n->script_count++;
}
if (r->set_stack_tag) {