[devhelp] Window: handle WebKitWebView::load-changed only for the active tab
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devhelp] Window: handle WebKitWebView::load-changed only for the active tab
- Date: Tue, 15 May 2018 10:11:12 +0000 (UTC)
commit b47c828064c24beb2be6458093d2a38b7707e644
Author: Sébastien Wilmet <swilmet gnome org>
Date: Tue May 15 12:00:44 2018 +0200
Window: handle WebKitWebView::load-changed only for the active tab
dh_sidebar_select_uri() is also called in
notebook_switch_page_after_cb().
There was a bug: opening a link in a new tab (with Ctrl+click or
middle-click) made the book tree to show the new page, but the notebook
doesn't switch to the new tab.
src/dh-window.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/dh-window.c b/src/dh-window.c
index 0b74a5f..3011349 100644
--- a/src/dh-window.c
+++ b/src/dh-window.c
@@ -1050,16 +1050,17 @@ web_view_decide_policy_cb (WebKitWebView *web_view,
}
static void
-web_view_load_changed_cb (WebKitWebView *web_view,
+web_view_load_changed_cb (DhWebView *web_view,
WebKitLoadEvent load_event,
DhWindow *window)
{
DhWindowPrivate *priv = dh_window_get_instance_private (window);
- if (load_event == WEBKIT_LOAD_COMMITTED) {
+ if (load_event == WEBKIT_LOAD_COMMITTED &&
+ web_view == get_active_web_view (window)) {
const gchar *uri;
- uri = webkit_web_view_get_uri (web_view);
+ uri = webkit_web_view_get_uri (WEBKIT_WEB_VIEW (web_view));
dh_sidebar_select_uri (priv->sidebar, uri);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]