summaryrefslogtreecommitdiff
path: root/src/bin/e_bg.c
diff options
context:
space:
mode:
authorrephorm <rephorm>2006-10-16 04:52:31 +0000
committerrephorm <rephorm@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>2006-10-16 04:52:31 +0000
commitbb126fe596b8b4696ba3b11a55306bd04021d8e2 (patch)
tree9257aac1f8628aa83e617d6aba9c818c63bf76f0 /src/bin/e_bg.c
parent1b91d3bfd176c4c4d6be782556200e2c1a1fbb2e (diff)
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
Diffstat (limited to 'src/bin/e_bg.c')
-rw-r--r--src/bin/e_bg.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/bin/e_bg.c b/src/bin/e_bg.c
index 2dc4c0d..7e06e34 100644
--- a/src/bin/e_bg.c
+++ b/src/bin/e_bg.c
@@ -14,22 +14,35 @@ e_bg_file_get(E_Zone *zone, E_Desk *desk)
14{ 14{
15 Evas_List *l, *ll, *entries; 15 Evas_List *l, *ll, *entries;
16 int ok; 16 int ok;
17 int current_spec;
17 const char *bgfile = ""; 18 const char *bgfile = "";
18 19
19 20
20 if (!zone) zone = e_zone_current_get(e_container_current_get(e_manager_current_get())); 21 if (!zone) zone = e_zone_current_get(e_container_current_get(e_manager_current_get()));
21 22
22 ok = 0; 23 ok = 0;
24 current_spec = 0; /* how specific the setting is - we want the least general one that applies */
25
23 /* look for desk specific background. if desk is NULL this is skipped */ 26 /* look for desk specific background. if desk is NULL this is skipped */
24 for (l = e_config->desktop_backgrounds; desk && l; l = l->next) 27 for (l = e_config->desktop_backgrounds; desk && l; l = l->next)
25 { 28 {
26 E_Config_Desktop_Background *cfbg; 29 E_Config_Desktop_Background *cfbg;
30 int spec;
27 31
28 cfbg = l->data; 32 cfbg = l->data;
29 if ((cfbg->container >= 0) && (zone->container->num != cfbg->container)) continue; 33 if ((cfbg->container >= 0) && (zone->container->num != cfbg->container)) continue;
30 if ((cfbg->zone >= 0) && (zone->num != cfbg->zone)) continue; 34 if ((cfbg->zone >= 0) && (zone->num != cfbg->zone)) continue;
31 if ((cfbg->desk_x >= 0) && (cfbg->desk_x != desk->x)) continue; 35 if ((cfbg->desk_x >= 0) && (cfbg->desk_x != desk->x)) continue;
32 if ((cfbg->desk_y >= 0) && (cfbg->desk_y != desk->y)) continue; 36 if ((cfbg->desk_y >= 0) && (cfbg->desk_y != desk->y)) continue;
37
38 spec = 0;
39 if (cfbg->container >= 0) spec++;
40 if (cfbg->zone >= 0) spec++;
41 if (cfbg->desk_x >= 0) spec++;
42 if (cfbg->desk_y >= 0) spec++;
43
44 if (spec <= current_spec) continue;
45
33 entries = edje_file_collection_list(cfbg->file); 46 entries = edje_file_collection_list(cfbg->file);
34 if (entries) 47 if (entries)
35 { 48 {
@@ -38,13 +51,12 @@ e_bg_file_get(E_Zone *zone, E_Desk *desk)
38 if (!strcmp(ll->data, "e/desktop/background")) 51 if (!strcmp(ll->data, "e/desktop/background"))
39 { 52 {
40 bgfile = cfbg->file; 53 bgfile = cfbg->file;
54 current_spec = spec;
41 ok = 1; 55 ok = 1;
42 break;
43 } 56 }
44 } 57 }
45 edje_file_collection_list_free(entries); 58 edje_file_collection_list_free(entries);
46 } 59 }
47 break;
48 } 60 }
49 /* fall back to default bg for zone */ 61 /* fall back to default bg for zone */
50 if (!ok) 62 if (!ok)