From e6f8a2932a9d66e905f0cf2e6d02fc17e1caad06 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Wed, 24 Aug 2016 21:44:47 +0200 Subject: Avoid starting the notification thread twice Starting the notification thread more than once can result in strange behavior. For example, when launching external commands, only the most recently started thread is stopped which results in the external command's screen output being overwritten by the notification bar. Currently, there are a couple of situations where the thread is started twice. As a first countermeasure, explicitly check whether the thread is already running (and terminate it) before starting a new one. Signed-off-by: Lukas Fleischer --- src/notify.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/notify.c b/src/notify.c index be88a31..3e14022 100644 --- a/src/notify.c +++ b/src/notify.c @@ -549,6 +549,9 @@ int notify_same_recur_item(struct recur_apoint *i) /* Launch the notify-bar main thread. */ void notify_start_main_thread(void) { + /* Avoid starting the notification bar thread twice. */ + notify_stop_main_thread(); + pthread_create(¬ify_t_main, NULL, notify_main_thread, NULL); notify_check_next_app(0); } -- cgit v1.2.3