and in an optimising spree i broke the bg reload if you replaced the file..

fix fix fix :)


SVN revision: 5734
This commit is contained in:
Carsten Haitzler 2001-11-25 12:49:39 +00:00
parent f6b9e19fce
commit 0ce64e39cf
2 changed files with 10 additions and 4 deletions

View File

@ -2345,6 +2345,7 @@ e_view_bg_load(E_View *v)
if (bg) if (bg)
{ {
v->bg = bg; v->bg = bg;
v->bg_mod = e_file_mod_time(v->bg_file);
if (v->evas) if (v->evas)
{ {
e_background_realize(v->bg, v->evas); e_background_realize(v->bg, v->evas);
@ -2369,8 +2370,14 @@ e_view_bg_reload_timeout(int val, void *data)
v = data; v = data;
if (!strcmp(v->prev_bg_file, v->bg_file)) if (!strcmp(v->prev_bg_file, v->bg_file))
{ {
D("abort bg reload - same damn file\n"); time_t new_mod;
D_RETURN;
new_mod = e_file_mod_time(v->bg_file);
if (new_mod == v->bg_mod)
{
D("abort bg reload - same damn file\n");
D_RETURN;
}
} }
if (v->bg) if (v->bg)
{ {
@ -2400,8 +2407,6 @@ e_view_bg_change(E_View *v, char *file)
D_ENTER; D_ENTER;
if (!(!strcmp(file, ".e_background.bg.db"))) return; if (!(!strcmp(file, ".e_background.bg.db"))) return;
IF_FREE(v->prev_bg_file);
e_strdup(v->prev_bg_file, "");
sprintf(buf, "background_reload:%s", v->dir); sprintf(buf, "background_reload:%s", v->dir);
ecore_add_event_timer(buf, 0.5, e_view_bg_reload_timeout, 0, v); ecore_add_event_timer(buf, 0.5, e_view_bg_reload_timeout, 0, v);

View File

@ -132,6 +132,7 @@ struct _E_View
char *bg_file; char *bg_file;
char *prev_bg_file; char *prev_bg_file;
time_t bg_mod;
E_Background *bg; E_Background *bg;
struct { struct {