diff options
| author | Federico Angelilli <code@fedang.net> | 2024-07-12 12:34:39 +0200 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2024-07-12 12:34:39 +0200 |
| commit | e45c7bc6b41fbcea84ca51d01b8661f93145ce7a (patch) | |
| tree | e07c3a4733f7b221efa4130bad1db1e48ccc90f4 /src/comet.c | |
| parent | e60937111eb8c7097e63da2bf253ea7425275636 (diff) | |
Add signal handler
Diffstat (limited to 'src/comet.c')
| -rw-r--r-- | src/comet.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/comet.c b/src/comet.c index c4d9f17..752f147 100644 --- a/src/comet.c +++ b/src/comet.c @@ -1,5 +1,6 @@ #include <stdlib.h> #include <locale.h> +#include <signal.h> #include <math.h> #include "window.h" @@ -23,6 +24,13 @@ #define ANY_LOG_IMPLEMENT #include "any_log.h" +static sig_atomic_t running = true; + +void signal_quit(int status) +{ + running = false; +} + static cairo_surface_t *render_all(layout_t *layout, config_t *config, layout_info_t info) { cairo_surface_t *surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, @@ -117,6 +125,7 @@ int main(int argc, char **argv) nanosleep(&diff, NULL); } + log_debug("Quitting"); g_object_unref(info.context); pango_font_description_free(fontdesc); |
