Add 'dbus-raise-window' setting

Certain D-Bus commands (e.g., all those from SyncTex) cause zathura's
window to be raised. However, this causes some workflows such as with
IDEA's texify with continuous auto-build to be problematic.
This commit is contained in:
Sebastian Ramacher 2021-07-13 08:50:27 +02:00
parent dcaf4c67e9
commit 62d6bdf789
3 changed files with 13 additions and 1 deletions

View File

@ -616,6 +616,13 @@ zathura
* Value type: Boolean
* Default value: true
*dbus-raise-window*
Defines whether zathura's window should be raised when receiving certain
commands via D-Bus.
* Value type: Boolean
* Default value: true
*filemonitor*
Defines the file monitor backend used to check for changes in files. Possible
values are "glib", "signal" (if signal handling is supported), and "noop". The

View File

@ -288,6 +288,7 @@ config_load_default(zathura_t* zathura)
girara_setting_add(gsession, "synctex-editor-command", "", STRING, false, _("Synctex editor command"), NULL, NULL);
bool_value = true;
girara_setting_add(gsession, "dbus-service", &bool_value, BOOLEAN, false, _("Enable D-Bus service"), NULL, NULL);
girara_setting_add(gsession, "dbus-raise-window", &bool_value, BOOLEAN, false, _("Raise window on certain D-Bus commands"), NULL, NULL);
bool_value = false;
girara_setting_add(gsession, "continuous-hist-save", &bool_value, BOOLEAN, false, _("Save history at each page change"), NULL, NULL);
girara_setting_add(gsession, "selection-clipboard", "primary", STRING, false, _("The clipboard into which mouse-selected data will be written"), NULL, NULL);

View File

@ -436,7 +436,11 @@ handle_method_call(GDBusConnection* UNUSED(connection),
(*handlers[idx].handler)(priv->zathura, parameters, invocation);
if (handlers[idx].present_window == true && priv->zathura->ui.session->gtk.embed == 0) {
gtk_window_present(GTK_WINDOW(priv->zathura->ui.session->gtk.window));
bool present_window = true;
girara_setting_get(priv->zathura->ui.session, "dbus-raise-window", &present_window);
if (present_window == true) {
gtk_window_present(GTK_WINDOW(priv->zathura->ui.session->gtk.window));
}
}
return;