From 409ed0bffe4cff4588e28efb5d1081e8dcefa74b Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Mon, 10 May 2010 19:26:46 +0000 Subject: [PATCH] Add handler for BG change and update home window(s) accordingly. SVN revision: 48739 --- src/modules/illume-home/e_mod_main.c | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/modules/illume-home/e_mod_main.c b/src/modules/illume-home/e_mod_main.c index 3d72b6442..9be0de4aa 100644 --- a/src/modules/illume-home/e_mod_main.c +++ b/src/modules/illume-home/e_mod_main.c @@ -55,6 +55,7 @@ static int _il_home_cb_exe_del(void *data __UNUSED__, int type __UNUSED__, void static int _il_home_cb_exe_timeout(void *data); static int _il_home_cb_client_message(void *data __UNUSED__, int type __UNUSED__, void *event); static int _il_home_cb_prop_change(void *data __UNUSED__, int type __UNUSED__, void *event); +static int _il_home_cb_bg_change(void *data __UNUSED__, int type __UNUSED__, void *event); /* local variables */ static Eina_List *hwins = NULL; @@ -104,6 +105,10 @@ e_modapi_init(E_Module *m) ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, _il_home_cb_prop_change, NULL)); + hdls = + eina_list_append(hdls, + ecore_event_handler_add(E_EVENT_BG_UPDATE, + _il_home_cb_bg_change, NULL)); EINA_LIST_FOREACH(e_manager_list(), ml, man) { @@ -723,3 +728,29 @@ _il_home_cb_prop_change(void *data __UNUSED__, int type __UNUSED__, void *event) return 1; } + +static int +_il_home_cb_bg_change(void *data __UNUSED__, int type __UNUSED__, void *event) +{ + Il_Home_Win *hwin; + Eina_List *l; + + if (type != E_EVENT_BG_UPDATE) return 1; + + EINA_LIST_FOREACH(hwins, l, hwin) + { + E_Zone *zone; + E_Desk *desk; + const char *bgfile; + + zone = hwin->zone; + desk = e_desk_current_get(zone); + if (desk) + bgfile = e_bg_file_get(zone->container->num, zone->num, desk->x, desk->y); + else + bgfile = e_bg_file_get(zone->container->num, zone->num, -1, -1); + edje_object_file_set(hwin->o_bg, bgfile, "e/desktop/background"); + } + + return 1; +}