Commit 26333fb2 authored by Sebastian Ramacher's avatar Sebastian Ramacher

Run D-Bus service all the time

Signed-off-by: Sebastian Ramacher's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent 7e2c0f2e
......@@ -213,7 +213,7 @@ config_load_default(zathura_t* zathura)
bool_value = false;
girara_setting_add(gsession, "synctex", &bool_value, BOOLEAN, false, _("Enable synctex support"), NULL, NULL);
bool_value = true;
girara_setting_add(gsession, "synctex-dbus-service", &bool_value, BOOLEAN, false, _("Enable D-Bus service for synctex forward synchronization support"), NULL, NULL);
girara_setting_add(gsession, "dbus-service", &bool_value, BOOLEAN, false, _("Enable D-Bus service"), NULL, NULL);
string_value = "primary";
girara_setting_add(gsession, "selection-clipboard", string_value, STRING, false, _("The clipboard into which mouse-selected data will be written"), NULL, NULL);
......
......@@ -229,6 +229,13 @@ zathura_init(zathura_t* zathura)
zathura->jumplist.size = 0;
zathura->jumplist.cur = NULL;
/* Start D-Bus service */
bool synctex_dbus = true;
girara_setting_get(zathura->ui.session, "dbus-service", &synctex_dbus);
if (synctex_dbus == true) {
zathura->synctex.dbus = zathura_synctex_dbus_new(zathura);
}
return true;
error_free:
......@@ -253,6 +260,12 @@ zathura_free(zathura_t* zathura)
document_close(zathura, false);
/* stop D-Bus */
if (zathura->synctex.dbus != NULL) {
g_object_unref(zathura->synctex.dbus);
zathura->synctex.dbus = NULL;
}
if (zathura->ui.session != NULL) {
girara_session_destroy(zathura->ui.session);
}
......@@ -786,13 +799,6 @@ document_open(zathura_t* zathura, const char* path, const char* password,
position_set(zathura, file_info.position_x, file_info.position_y);
}
/* Start D-Bus service for synctex forward synchronization */
bool synctex_dbus = true;
girara_setting_get(zathura->ui.session, "synctex-dbus-service", &synctex_dbus);
if (synctex_dbus == true) {
zathura->synctex.dbus = zathura_synctex_dbus_new(zathura);
}
return true;
error_free:
......@@ -875,12 +881,6 @@ document_close(zathura_t* zathura, bool keep_monitor)
/* stop rendering */
zathura_renderer_stop(zathura->sync.render_thread);
/* stop D-Bus */
if (zathura->synctex.dbus != NULL) {
g_object_unref(zathura->synctex.dbus);
zathura->synctex.dbus = NULL;
}
/* remove monitor */
if (keep_monitor == false) {
if (zathura->file_monitor.monitor != NULL) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment