Merge lp:~aauzi/midori/hack-webkit2-load_changed-event into lp:midori

Proposed by André Auzi
Status: Merged
Approved by: Cris Dywan
Approved revision: 6423
Merged at revision: 6433
Proposed branch: lp:~aauzi/midori/hack-webkit2-load_changed-event
Merge into: lp:midori
Diff against target: 43 lines (+16/-10)
1 file modified
extensions/tabby.vala (+16/-10)
To merge this branch: bzr merge lp:~aauzi/midori/hack-webkit2-load_changed-event
Reviewer Review Type Date Requested Status
Cris Dywan Approve
André Stösel Approve
Review via email: mp+188204@code.launchpad.net

Commit message

Make tabby compile with Webkit2

Description of the change

Quite a dirty fix (my vala skills are still at the bottom of the learning curve) but it seems to work on my Fedora with:

Command line _build/default/midori/midori
Midori 0.5.5~r6420 (de.twotoasts.midori_e7e5c179f38dd5f87e718c968d7c09f0_fea087517c26fadd409bd4b9dc642555__0)
GTK+ 3.8.4 (3.8.4) Glib 2.36.3 (2.36.3)
WebKit2GTK+ 2.0.4 (2.0.4) libSoup 2.42.2
cairo 1.12.14 (1.12.14) libnotify 0.7.5
gcr 3.8.2 granite No
Platform X11; Linux i686
Identification Mozilla/5.0 (X11; Linux) AppleWebKit/537.32 (KHTML, like Gecko) Chrome/18.0.1025.133 Safari/537.32 Midori/0.5

To post a comment you must log in.
Revision history for this message
Cris Dywan (kalikiana) wrote :

Question: can we use Midori.View here - as it already abstracts WebKit? Might be for the other André to clarify if there was a reason to use WebKit API.

review: Needs Information
Revision history for this message
Kevin Fenzi (kevin-launchpad) wrote :

I'll note that this doesn't hit the cmake build, as it doesn't seem to build this extension?

(I assume the problem is still there of course)

Revision history for this message
André Stösel (ivaldi) wrote :

Hm, there is no signal in Midori.View -> we would have to add one.
I think we should leave it for now.

Revision history for this message
André Stösel (ivaldi) :
review: Approve
Revision history for this message
André Stösel (ivaldi) wrote :

@Stéphane Marguet
please don't change the status if there is still a review opened

Revision history for this message
Cris Dywan (kalikiana) wrote :

You can connect to "notify::load-event" or notify["load-event"] on the Midori.View, it's a property.

review: Needs Fixing
Revision history for this message
André Auzi (aauzi) wrote :

> You can connect to "notify::load-event" or notify["load-event"] on the
> Midori.View, it's a property.

hmmm, isn't it notify::load-status instead?
It's the only property I could find related to load change in the parent classes of Midori.View, in Midori.Tab actually.

6421. By André Auzi

use load_status instead of WebKit2 load_changed event

6422. By André Auzi

Merge lp:midori

6423. By André Auzi

untabify

Revision history for this message
André Auzi (aauzi) wrote :

> You can connect to "notify::load-event" or notify["load-event"] on the
> Midori.View, it's a property.

notify["load_status"] seems to work... I'd appreciate if somebody more familiar with the tabby extension could confirm the correct behavior.

And let me know, since we are at it, if we should extend this to the:
 view.web_view.notify["uri"].connect ( () => {
 view.web_view.notify["title"].connect ( () => {

which also are properties of Midori.view if I'm not mistaken.

I'll do the change.

Revision history for this message
Cris Dywan (kalikiana) wrote :

Sorry, you're quite right, load-event was a typo.

Yes uri and title from Midori.View can be used, this would help moving closer to native GTK+ based tabs without a web view. Though not strictly required for the build fix.
FYI it builds and runs as-is.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'extensions/tabby.vala'
2--- extensions/tabby.vala 2013-10-06 12:28:16 +0000
3+++ extensions/tabby.vala 2013-10-11 15:20:19 +0000
4@@ -204,23 +204,29 @@
5 return this_sorting;
6 }
7
8- private void helper_data_changed (Midori.Browser browser, Midori.View view) {
9- ulong sig_id = 0;
10- sig_id = view.web_view.load_started.connect (() => {
11+ private void load_status (GLib.Object _view, ParamSpec pspec) {
12+ Midori.View view = (Midori.View)_view;
13+
14+ if (view.load_status == Midori.LoadStatus.PROVISIONAL) {
15 unowned Katze.Item item = view.get_proxy_item ();
16-
17+
18 int64 delay = item.get_meta_integer ("delay");
19 if (delay == Midori.Delay.UNDELAYED) {
20 view.web_view.notify["uri"].connect ( () => {
21- this.uri_changed (view, view.web_view.uri);
22- });
23+ this.uri_changed (view, view.web_view.uri);
24+ });
25 view.web_view.notify["title"].connect ( () => {
26- this.data_changed (view);
27- });
28+ this.data_changed (view);
29+ });
30
31- GLib.SignalHandler.disconnect (view.web_view, sig_id);
32 }
33- });
34+
35+ view.notify["load-status"].disconnect (load_status);
36+ }
37+ }
38+
39+ private void helper_data_changed (Midori.Browser browser, Midori.View view) {
40+ view.notify["load-status"].connect (load_status);
41 }
42
43 private void helper_reorder_tabs (GLib.PtrArray new_tabs) {

Subscribers

People subscribed via source and target branches

to all changes: