Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
pwmt
zathura
Commits
8409fb2a
Commit
8409fb2a
authored
Apr 23, 2014
by
Moritz Lipp
Browse files
Catch SIGTERM on UNIX targets
parent
fb088e1f
Changes
2
Hide whitespace changes
Inline
Side-by-side
zathura.c
View file @
8409fb2a
...
...
@@ -17,6 +17,10 @@
#include <glib/gstdio.h>
#include <glib/gi18n.h>
#ifdef G_OS_UNIX
#include <glib-unix.h>
#endif
#include "bookmarks.h"
#include "callbacks.h"
#include "config.h"
...
...
@@ -50,6 +54,10 @@ static void zathura_jumplist_reset_current(zathura_t* zathura);
static
void
zathura_jumplist_append_jump
(
zathura_t
*
zathura
);
static
void
zathura_jumplist_save
(
zathura_t
*
zathura
);
#ifdef G_OS_UNIX
static
gboolean
zathura_signal_sigterm
(
gpointer
data
);
#endif
/* function implementation */
zathura_t
*
zathura_create
(
void
)
...
...
@@ -73,6 +81,11 @@ zathura_create(void)
goto
error_out
;
}
#ifdef G_OS_UNIX
/* signal handler */
zathura
->
signals
.
sigterm
=
g_unix_signal_add
(
SIGTERM
,
zathura_signal_sigterm
,
zathura
);
#endif
zathura
->
ui
.
session
->
global
.
data
=
zathura
;
return
zathura
;
...
...
@@ -1384,3 +1397,18 @@ zathura_jumplist_save(zathura_t* zathura)
cur
->
y
=
zathura_document_get_position_y
(
zathura
->
document
);
}
}
#ifdef G_OS_UNIX
static
gboolean
zathura_signal_sigterm
(
gpointer
data
)
{
if
(
data
==
NULL
)
{
return
TRUE
;
}
zathura_t
*
zathura
=
(
zathura_t
*
)
data
;
cb_destroy
(
NULL
,
zathura
);
return
TRUE
;
}
#endif
zathura.h
View file @
8409fb2a
...
...
@@ -174,6 +174,9 @@ struct zathura_s
struct
{
guint
refresh_view
;
#ifdef G_OS_UNIX
guint
sigterm
;
#endif
}
signals
;
struct
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment