Merge lp:~laney/unity-control-center/wk2 into lp:unity-control-center

Proposed by Iain Lane
Status: Merged
Approved by: Sebastien Bacher
Approved revision: no longer in the source branch.
Merged at revision: 12848
Proposed branch: lp:~laney/unity-control-center/wk2
Merge into: lp:unity-control-center
Diff against target: 114 lines (+40/-27)
3 files modified
configure.ac (+1/-1)
debian/control (+1/-1)
panels/info/cc-info-panel.c (+38/-25)
To merge this branch: bzr merge lp:~laney/unity-control-center/wk2
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
Unity Control Center development team Pending
Review via email: mp+282487@code.launchpad.net

Commit message

Port the info WebView to WebKit 2

Description of the change

Port the info WebView to WebKit 2

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for the work!

There are some small issues though

* you deleted the gtk_scrolled_window_new () call but kept the sw variable and still use it as "user_data" in the callback which triggers a warning about user_data not being a valid GTK_WIDGET

* detail and was there before, but "gtk_widget_show_all(" lacks a space before the parenthesis, could you it while you are changing this line? ;-)

* the scrollbars have glitches/redraw issues here, do you see that as well? (it might be a webkit2 issue, doesn't do that with the current version though so it's an user experience regression and we should at least have a milestoned bug about it)

review: Needs Fixing
Revision history for this message
Iain Lane (laney) wrote :

Thanks for the review.

On Wed, Jan 13, 2016 at 06:21:07PM -0000, Sebastien Bacher wrote:
> Review: Needs Fixing
>
> Thanks for the work!
>
> There are some small issues though
>
> * you deleted the gtk_scrolled_window_new () call but kept the sw variable and still use it as "user_data" in the callback which triggers a warning about user_data not being a valid GTK_WIDGET

Ok, fixed, thanks.

>
> * detail and was there before, but "gtk_widget_show_all(" lacks a space before the parenthesis, could you it while you are changing this line? ;-)

Ok.

>
> * the scrollbars have glitches/redraw issues here, do you see that as well? (it might be a webkit2 issue, doesn't do that with the current version though so it's an user experience regression and we should at least have a milestoned bug about it)

It's a WebKit and theme problem. Trevinho was looking at it a while ago.

--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]

Revision history for this message
Sebastien Bacher (seb128) wrote :

thanks, that looks fine, we should open a bug about the webkit issue but that's rather an item blocking the webkitgtk2 transition landing than one for that specific changeset

review: Approve
lp:~laney/unity-control-center/wk2 updated
12844. By Iain Lane

Update the legal notice to fix a broken link and reflect dash search being off by default Fixes: #1534085
Approved by: Sebastien Bacher

12845. By CI Train Bot Account

Releasing 15.04.0+16.04.20160119-0ubuntu1

12846. By Iain Lane

Merge with trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'configure.ac'
2--- configure.ac 2015-12-14 10:09:05 +0000
3+++ configure.ac 2016-02-09 13:07:03 +0000
4@@ -140,7 +140,7 @@
5 polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION)
6 PKG_CHECK_MODULES(DISPLAY_PANEL, $COMMON_MODULES libunity-settings-daemon x11)
7 PKG_CHECK_MODULES(INFO_PANEL, $COMMON_MODULES libgtop-2.0 gl x11
8- polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION webkitgtk-3.0)
9+ polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION webkit2gtk-4.0)
10 PKG_CHECK_MODULES(KEYBOARD_PANEL, $COMMON_MODULES
11 gnome-desktop-3.0 >= $GNOME_DESKTOP_REQUIRED_VERSION
12 x11)
13
14=== modified file 'debian/control'
15--- debian/control 2015-12-14 10:09:05 +0000
16+++ debian/control 2016-02-09 13:07:03 +0000
17@@ -57,7 +57,7 @@
18 network-manager-dev (>= 0.9.6.4) [linux-any],
19 shared-mime-info,
20 ttf-ubuntu-font-family,
21- libwebkitgtk-3.0-dev,
22+ libwebkit2gtk-4.0-dev,
23 libgl1-mesa-dev,
24 valac (>= 0.20.0),
25 Vcs-Bzr: https://code.launchpad.net/~unity-control-center-team/unity-control-center/trunk
26
27=== modified file 'panels/info/cc-info-panel.c'
28--- panels/info/cc-info-panel.c 2015-02-02 09:28:42 +0000
29+++ panels/info/cc-info-panel.c 2016-02-09 13:07:03 +0000
30@@ -40,7 +40,7 @@
31 #include <GL/gl.h>
32 #include <GL/glx.h>
33
34-#include <webkit/webkit.h>
35+#include <webkit2/webkit2.h>
36
37 #include "hostname-helper.h"
38 #include "gsd-disk-space-helper.h"
39@@ -733,38 +733,51 @@
40 gtk_tree_path_free (path);
41 }
42
43-static gboolean
44-url_nav_callback (WebKitWebView *web_view,
45- WebKitWebFrame *frame,
46- WebKitNetworkRequest *request,
47- WebKitWebNavigationAction *navigation_action,
48- WebKitWebPolicyDecision *decision,
49- gpointer user_data)
50+static gboolean
51+on_decide_policy (WebKitWebView *web_view,
52+ WebKitPolicyDecision *decision,
53+ WebKitPolicyDecisionType decision_type,
54+ gpointer user_data)
55 {
56- gtk_show_uri (gtk_widget_get_screen (user_data),
57- webkit_network_request_get_uri (request),
58- GDK_CURRENT_TIME, NULL);
59- return TRUE;
60+ WebKitNavigationPolicyDecision *navigation_decision;
61+ WebKitNavigationAction *navigation_action;
62+ WebKitNavigationType navigation_type;
63+ WebKitURIRequest *request;
64+ const gchar *uri;
65+
66+ switch (decision_type)
67+ {
68+ case WEBKIT_POLICY_DECISION_TYPE_NAVIGATION_ACTION:
69+ navigation_decision = WEBKIT_NAVIGATION_POLICY_DECISION(decision);
70+ navigation_action = webkit_navigation_policy_decision_get_navigation_action (navigation_decision);
71+ request = webkit_navigation_action_get_request (navigation_action);
72+ navigation_type = webkit_navigation_action_get_navigation_type (navigation_action);
73+
74+ if (navigation_type == WEBKIT_NAVIGATION_TYPE_LINK_CLICKED)
75+ {
76+ uri = webkit_uri_request_get_uri (request);
77+
78+ webkit_policy_decision_ignore (decision);
79+
80+ gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (web_view)),
81+ uri, GDK_CURRENT_TIME, NULL);
82+ return TRUE;
83+ }
84+ default:
85+ return FALSE;
86+ }
87 }
88
89 static void
90 info_panel_setup_notice (CcInfoPanel *self)
91 {
92- GtkWidget *sw;
93-
94- sw = gtk_scrolled_window_new (NULL, NULL);
95- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
96- GTK_POLICY_AUTOMATIC,
97- GTK_POLICY_AUTOMATIC);
98-
99- WebKitWebView *webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
100+ WebKitWebView *webView = WEBKIT_WEB_VIEW (webkit_web_view_new());
101 webkit_web_view_load_uri(webView, "file:///usr/share/unity-control-center/searchingthedashlegalnotice.html");
102- g_signal_connect (G_OBJECT (webView), "navigation-policy-decision-requested",
103- G_CALLBACK (url_nav_callback), sw);
104+ g_signal_connect (G_OBJECT (webView), "decide-policy",
105+ G_CALLBACK (on_decide_policy), NULL);
106
107- gtk_container_add (GTK_CONTAINER (sw), GTK_WIDGET (webView));
108- gtk_notebook_append_page (GTK_NOTEBOOK (WID ("notebook")), sw, NULL);
109- gtk_widget_show_all(sw);
110+ gtk_notebook_append_page (GTK_NOTEBOOK (WID ("notebook")), GTK_WIDGET (webView), NULL);
111+ gtk_widget_show_all (GTK_WIDGET (webView));
112 }
113
114 static void

Subscribers

People subscribed via source and target branches