diff options
-rw-r--r-- | BUGS | 15 | ||||
-rw-r--r-- | CHANGES | 6 | ||||
-rw-r--r-- | browser.c | 33 |
3 files changed, 35 insertions, 19 deletions
@@ -0,0 +1,15 @@ +Links sometimes do not open in a new tab +======================================== + +We select for "mouse-target-changed" events: When the pointer is being +moved, WebKit tells us if it's now being positioned over a link or not. + +However, when a new link pops into existence right below the mouse +pointer (without the pointer being moved), we don't get this event. When +the user now issues a middle-click, we open the link in the same tab. +This is wrong. + +Ideally, we could access a hit test result while processing the click +event, but that doesn't appear to be possible? + +This bug is also present in suckless surf and GNOME Epiphany. @@ -1,5 +1,11 @@ Release history for lariza +next + [Fixed] + - Middle-click to open in a new tab has been improved. In certain + conditions, the user's intention to open a new tab has been ignored + and URLs haven been opened in the current tab. + v20.07 2020-07-19 [Fixed] - Build no longer depends on GNU sed. @@ -767,28 +767,23 @@ hover_web_view(WebKitWebView *web_view, WebKitHitTestResult *ht, guint modifiers gpointer data) { struct Client *c = (struct Client *)data; + const char *to_show; - if (!gtk_widget_is_focus(c->location)) - { - if (webkit_hit_test_result_context_is_link(ht)) - { - gtk_entry_set_text(GTK_ENTRY(c->location), - webkit_hit_test_result_get_link_uri(ht)); - - if (c->hover_uri != NULL) - g_free(c->hover_uri); - c->hover_uri = g_strdup(webkit_hit_test_result_get_link_uri(ht)); - } - else - { - gtk_entry_set_text(GTK_ENTRY(c->location), - webkit_web_view_get_uri(WEBKIT_WEB_VIEW(c->web_view))); + g_free(c->hover_uri); - if (c->hover_uri != NULL) - g_free(c->hover_uri); - c->hover_uri = NULL; - } + if (webkit_hit_test_result_context_is_link(ht)) + { + to_show = webkit_hit_test_result_get_link_uri(ht); + c->hover_uri = g_strdup(to_show); } + else + { + to_show = webkit_web_view_get_uri(WEBKIT_WEB_VIEW(c->web_view)); + c->hover_uri = NULL; + } + + if (!gtk_widget_is_focus(c->location)) + gtk_entry_set_text(GTK_ENTRY(c->location), to_show); } void |