Only consider a favicon for redraw/done if an event *caused* it to become ready

svn path=/trunk/netsurf/; revision=11239
This commit is contained in:
Daniel Silverstone 2011-01-07 12:12:47 +00:00
parent 68f8fa1059
commit 72683554b4
1 changed files with 6 additions and 2 deletions

View File

@ -10,7 +10,7 @@
* *
* NetSurf is distributed in the hope that it will be useful, * NetSurf is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
@ -188,6 +188,7 @@ nserror favicon_callback(hlcache_handle *icon,
const hlcache_event *event, void *pw) const hlcache_event *event, void *pw)
{ {
struct content *c = pw; struct content *c = pw;
bool consider_redraw = false;
switch (event->type) { switch (event->type) {
case CONTENT_MSG_LOADING: case CONTENT_MSG_LOADING:
@ -201,6 +202,7 @@ nserror favicon_callback(hlcache_handle *icon,
hlcache_handle_release(icon); hlcache_handle_release(icon);
c->data.html.favicon = NULL; c->data.html.favicon = NULL;
c->active -= 1; c->active -= 1;
consider_redraw = true;
content_add_error(c, "NotFavIco", 0); content_add_error(c, "NotFavIco", 0);
@ -213,6 +215,7 @@ nserror favicon_callback(hlcache_handle *icon,
break; break;
case CONTENT_MSG_DONE: case CONTENT_MSG_DONE:
c->active -= 1; c->active -= 1;
consider_redraw = true;
break; break;
case CONTENT_MSG_ERROR: case CONTENT_MSG_ERROR:
@ -224,6 +227,7 @@ nserror favicon_callback(hlcache_handle *icon,
content_add_error(c, "?", 0); content_add_error(c, "?", 0);
c->active -= 1; c->active -= 1;
consider_redraw = true;
break; break;
case CONTENT_MSG_STATUS: case CONTENT_MSG_STATUS:
@ -241,7 +245,7 @@ nserror favicon_callback(hlcache_handle *icon,
assert(0); assert(0);
} }
if (c->active == 0) { if (consider_redraw && (c->active == 0)) {
/* all objects have arrived */ /* all objects have arrived */
content__reformat(c, c->available_width, c->height); content__reformat(c, c->available_width, c->height);
html_set_status(c, ""); html_set_status(c, "");