fix wallpaper setting by screen

correct wallpaper is now found if "this screen" AND "this desktop" have been set (in that order)


SVN revision: 26648
This commit is contained in:
rephorm 2006-10-16 04:52:31 +00:00 committed by rephorm
parent 1b91d3bfd1
commit bb126fe596
2 changed files with 17 additions and 12 deletions

View File

@ -14,22 +14,35 @@ e_bg_file_get(E_Zone *zone, E_Desk *desk)
{
Evas_List *l, *ll, *entries;
int ok;
int current_spec;
const char *bgfile = "";
if (!zone) zone = e_zone_current_get(e_container_current_get(e_manager_current_get()));
ok = 0;
current_spec = 0; /* how specific the setting is - we want the least general one that applies */
/* look for desk specific background. if desk is NULL this is skipped */
for (l = e_config->desktop_backgrounds; desk && l; l = l->next)
{
E_Config_Desktop_Background *cfbg;
int spec;
cfbg = l->data;
if ((cfbg->container >= 0) && (zone->container->num != cfbg->container)) continue;
if ((cfbg->zone >= 0) && (zone->num != cfbg->zone)) continue;
if ((cfbg->desk_x >= 0) && (cfbg->desk_x != desk->x)) continue;
if ((cfbg->desk_y >= 0) && (cfbg->desk_y != desk->y)) continue;
spec = 0;
if (cfbg->container >= 0) spec++;
if (cfbg->zone >= 0) spec++;
if (cfbg->desk_x >= 0) spec++;
if (cfbg->desk_y >= 0) spec++;
if (spec <= current_spec) continue;
entries = edje_file_collection_list(cfbg->file);
if (entries)
{
@ -38,13 +51,12 @@ e_bg_file_get(E_Zone *zone, E_Desk *desk)
if (!strcmp(ll->data, "e/desktop/background"))
{
bgfile = cfbg->file;
current_spec = spec;
ok = 1;
break;
}
}
edje_file_collection_list_free(entries);
}
break;
}
/* fall back to default bg for zone */
if (!ok)

View File

@ -716,16 +716,9 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
cfbg = l->data;
if (
(((cfbg->container == z->container->num) ||
(cfbg->container < 0)) &&
((cfbg->zone == 0) ||
(cfbg->zone < 0)))
||
(((cfbg->zone == z->num) ||
(cfbg->zone < 0)) &&
((cfbg->container == 0) ||
(cfbg->container < 0)))
)
(cfbg->container == z->container->num) &&
(cfbg->zone == z->num)
)
fl = evas_list_append(fl, cfbg);
}
while (fl)