diff --git a/src/toxic.c b/src/toxic.c index d175e7a..ea155df 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -92,7 +92,7 @@ static struct _user_password { static void catch_SIGINT(int sig) { - Winthread.sig_exit_toxic = true; + Winthread.sig_exit_toxic = 1; } static void catch_SIGSEGV(int sig) @@ -105,7 +105,7 @@ static void catch_SIGSEGV(int sig) static void flag_window_resize(int sig) { - Winthread.flag_resize = true; + Winthread.flag_resize = 1; } static void init_signal_catchers(void) @@ -727,7 +727,7 @@ void *thread_winref(void *data) if (Winthread.flag_resize) { on_window_resize(); - Winthread.flag_resize = false; + Winthread.flag_resize = 0; } else if (draw_count >= INACTIVE_WIN_REFRESH_RATE) { refresh_inactive_windows(); draw_count = 0; diff --git a/src/windows.h b/src/windows.h index f9cf0ac..1b53a01 100644 --- a/src/windows.h +++ b/src/windows.h @@ -26,6 +26,7 @@ #include #include #include +#include #include @@ -67,8 +68,8 @@ typedef enum { struct _Winthread { pthread_t tid; pthread_mutex_t lock; - bool sig_exit_toxic; - bool flag_resize; + volatile sig_atomic_t sig_exit_toxic; + volatile sig_atomic_t flag_resize; }; struct _cqueue_thread {