talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit ab847472955f979cb63bf0a9b576383e51ef5094
parent fd6bb2ab3c69ddfbe3e500f011186bdde6ab6a62
Author: Andrej Kacian <ticho@claws-mail.org>
Date:   Sat, 22 Apr 2017 01:15:30 +0200

Fancy: simplify open-or-not decision to x,y matching or not

Fixes bug #3814:  end of mouse drag or text selection erroneously
activates links

Diffstat:
Msrc/plugins/fancy/fancy_viewer.c | 12+++++-------
1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/plugins/fancy/fancy_viewer.c b/src/plugins/fancy/fancy_viewer.c @@ -826,21 +826,19 @@ static gint keypress_events_cb (GtkWidget *widget, GdkEventKey *event, static gboolean release_button_cb (WebKitWebView *view, GdkEvent *ev, FancyViewer *viewer) { - gint type, x, y; + gint x, y; WebKitHitTestResult *result; if (ev->button.button == 1 && viewer->cur_link && viewer->override_prefs_external) { result = webkit_web_view_get_hit_test_result(view, (GdkEventButton *)ev); g_object_get(G_OBJECT(result), - "context", &type, "x", &x, "y", &y, NULL); - /* If the link we are hovering over is also part of a text - * selection, we only want to open it if this button release - * is part of a simple click, not a press-drag-release chain. */ - if (type & WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION - && (x != viewer->click_x || y != viewer->click_y)) + /* If this button release is end of a drag or selection event + * (button press happened on different coordinates), we do not + * want to open the link. */ + if ((x != viewer->click_x || y != viewer->click_y)) return FALSE; open_uri(viewer->cur_link, prefs_common_get_uri_cmd());