From d668b3b6aa215a9ff6a501c2888faa85cdea44b6 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Wed, 24 Dec 2008 02:54:14 +0200 Subject: [PATCH] mouse: Exit cursor-routing mode when a link is clicked Before this patch, if you first moved the cursor to link X with move-cursor-up and similar actions, and then clicked link Y with the mouse, ELinks would activate link X, i.e. not the one you clicked. This happened because the NAVIGATE_CURSOR_ROUTING mode was left enabled and made ELinks ignore the doc_view->vs->current_link member that ELinks had updated according to the click. Make ELinks return the session to NAVIGATE_LINKWISE mode, so that the update takes effect. Reported by Paul B. Mahol. (cherry picked from commit 408641806937851f9cce354b356c39ab382c6f8b) --- NEWS | 2 ++ src/viewer/text/view.c | 1 + 2 files changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 11ed89bc..ab36a8e7 100644 --- a/NEWS +++ b/NEWS @@ -242,6 +242,8 @@ To be released as 0.11.6. * major bug 1004: ignore locales when comparing HTML element names and similar strings, so e.g. ``title'' matches ``TITLE'' even in the Turkish locale +* minor: clicking a link with the mouse activates that link, rather + than the one selected with move-cursor-* actions ELinks 0.11.5: -------------- diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c index 407be69a..df7fa0eb 100644 --- a/src/viewer/text/view.c +++ b/src/viewer/text/view.c @@ -1167,6 +1167,7 @@ frame_ev_mouse(struct session *ses, struct document_view *doc_view, struct term_ enum frame_event_status status = FRAME_EVENT_REFRESH; doc_view->vs->current_link = link - doc_view->document->links; + ses->navigate_mode = NAVIGATE_LINKWISE; if (!link_is_textinput(link)) {