Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
pwmt
zathura
Commits
593d8063
Commit
593d8063
authored
Mar 07, 2012
by
Moritz Lipp
Browse files
Close open document in cb_destroy
parent
e73ca51d
Changes
3
Hide whitespace changes
Inline
Side-by-side
callbacks.c
View file @
593d8063
...
...
@@ -18,8 +18,13 @@
#include "page_widget.h"
gboolean
cb_destroy
(
GtkWidget
*
UNUSED
(
widget
),
gpointer
UNUSED
(
dat
a
)
)
cb_destroy
(
GtkWidget
*
UNUSED
(
widget
),
zathura_t
*
zathur
a
)
{
if
(
zathura
!=
NULL
&&
zathura
->
document
!=
NULL
)
{
zathura_document_free
(
zathura
->
document
);
zathura
->
document
=
NULL
;
}
gtk_main_quit
();
return
TRUE
;
}
...
...
callbacks.h
View file @
593d8063
...
...
@@ -8,15 +8,16 @@
#include <girara/macros.h>
#include "document.h"
#include "zathura.h"
/**
* Quits the current zathura session
*
* @param widget The gtk window of zathura
* @param
data NULL
* @param
zathura Correspondending zathura session
* @return true if no error occured and the event has been handled
*/
gboolean
cb_destroy
(
GtkWidget
*
widget
,
gpointer
dat
a
);
gboolean
cb_destroy
(
GtkWidget
*
widget
,
zathura_t
*
zathur
a
);
/**
* This function gets called when the buffer of girara changes
...
...
zathura.c
View file @
593d8063
...
...
@@ -225,7 +225,7 @@ zathura_init(int argc, char* argv[])
girara_statusbar_item_set_text
(
zathura
->
ui
.
session
,
zathura
->
ui
.
statusbar
.
file
,
"[No Name]"
);
/* signals */
g_signal_connect
(
G_OBJECT
(
zathura
->
ui
.
session
->
gtk
.
window
),
"destroy"
,
G_CALLBACK
(
cb_destroy
),
NULL
);
g_signal_connect
(
G_OBJECT
(
zathura
->
ui
.
session
->
gtk
.
window
),
"destroy"
,
G_CALLBACK
(
cb_destroy
),
zathura
);
/* save page padding */
zathura
->
global
.
page_padding
=
1
;
...
...
Write
Preview
Supports
Markdown
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