Merge lp:~gue5t/midori/network-error into lp:midori

Proposed by gue5t gue5t
Status: Merged
Approved by: Paweł Forysiuk
Approved revision: 6914
Merged at revision: 6914
Proposed branch: lp:~gue5t/midori/network-error
Merge into: lp:midori
Diff against target: 14 lines (+3/-1)
1 file modified
midori/midori-view.c (+3/-1)
To merge this branch: bzr merge lp:~gue5t/midori/network-error
Reviewer Review Type Date Requested Status
Paweł Forysiuk Approve
Review via email: mp+254487@code.launchpad.net

Commit message

Only set tabs' error state if errors come from the main frame

Description of the change

Right now, tabs showing pages that have iframes that hit unconditional network errors get reloaded every time the network monitor says it the network is available.

This happens regularly (on my machine at least) while the network is continuously available; midori_app_network_changed gets called various times in a row with "available" equal to TRUE. And when it does, if a tab happens to contain deep in iframes one frame that hit a network error, Midori reloads the whole tab which is already showing a useful page that the user might be working with. This trashes anything they've entered into forms and resets scroll position.

To fix the problem, we only set the load error status of a tab if the main frame of the tab's view is the one that generates the error.

To post a comment you must log in.
Revision history for this message
Paweł Forysiuk (tuxator) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'midori/midori-view.c'
2--- midori/midori-view.c 2015-03-24 23:03:26 +0000
3+++ midori/midori-view.c 2015-03-28 17:43:34 +0000
4@@ -1256,7 +1256,9 @@
5 message, error->message, NULL,
6 _("Try Again"), web_frame);
7
8- midori_tab_set_load_error (MIDORI_TAB (view), MIDORI_LOAD_ERROR_NETWORK);
9+ /* if the main frame for the whole tab has a network error, set tab error status */
10+ if (web_frame == webkit_web_view_get_main_frame (web_view))
11+ midori_tab_set_load_error (MIDORI_TAB (view), MIDORI_LOAD_ERROR_NETWORK);
12
13 g_free (message);
14 g_free (title);

Subscribers

People subscribed via source and target branches

to all changes: