From d61fe4a3749b3ded0b7e8ca4d44d6a0fe9e9f30e Mon Sep 17 00:00:00 2001 From: Iamnotagenius Date: Sun, 26 Mar 2023 01:07:55 +0300 Subject: [PATCH] Implement 'double-click-follow' option --- zathura/page-widget.c | 6 +++++- zathura/zathura.c | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/zathura/page-widget.c b/zathura/page-widget.c index e20b227..d32c184 100644 --- a/zathura/page-widget.c +++ b/zathura/page-widget.c @@ -983,7 +983,9 @@ cb_zathura_page_widget_button_release_event(GtkWidget* widget, GdkEventButton* b if (priv->mouse.selection.y2 == -1 && priv->mouse.selection.x2 == -1 ) { /* simple single click */ /* get links */ - evaluate_link_at_mouse_position(page, oldx, oldy); + if (priv->zathura->global.double_click_follow) { + evaluate_link_at_mouse_position(page, oldx, oldy); + } } else { zathura_rectangle_t tmp = priv->mouse.selection; @@ -996,6 +998,8 @@ cb_zathura_page_widget_button_release_event(GtkWidget* widget, GdkEventButton* b if (text != NULL && *text != '\0') { /* emit text-selected signal */ g_signal_emit(ZATHURA_PAGE(widget), signals[TEXT_SELECTED], 0, text); + } else if (priv->zathura->global.double_click_follow == false) { + evaluate_link_at_mouse_position(page, oldx, oldy); } g_free(text); } diff --git a/zathura/zathura.c b/zathura/zathura.c index e3403ae..6a6cae3 100644 --- a/zathura/zathura.c +++ b/zathura/zathura.c @@ -96,6 +96,7 @@ zathura_create(void) /* global settings */ zathura->global.search_direction = FORWARD; zathura->global.sandbox = ZATHURA_SANDBOX_NORMAL; + zathura->global.double_click_follow = true; /* plugins */ zathura->plugins.manager = zathura_plugin_manager_new();