summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-12-21 15:29:43 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-12-21 15:29:43 +0000
commitc7f20b65c518333149f1d4a4881604e768ca6db3 (patch)
treee241faa9a372e58da7433a73545b90d503ad9452
parent6e7b994ed4ef31fa2ac842dd6a5f98f7ee386c94 (diff)
update backlight gadgets at module init end
SVN revision: 81555
-rw-r--r--src/modules/backlight/e_mod_main.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/modules/backlight/e_mod_main.c b/src/modules/backlight/e_mod_main.c
index 97bb83f95..1252ceb72 100644
--- a/src/modules/backlight/e_mod_main.c
+++ b/src/modules/backlight/e_mod_main.c
@@ -47,7 +47,7 @@ struct _Instance
47static Eina_List *backlight_instances = NULL; 47static Eina_List *backlight_instances = NULL;
48static E_Module *backlight_module = NULL; 48static E_Module *backlight_module = NULL;
49static E_Action *act = NULL; 49static E_Action *act = NULL;
50static Ecore_Event_Handler *handler = NULL; 50static Eina_List *handlers;
51 51
52 52
53static void _backlight_popup_free(Instance *inst); 53static void _backlight_popup_free(Instance *inst);
@@ -460,6 +460,21 @@ _e_mod_action_cb(E_Object *obj __UNUSED__,
460} 460}
461 461
462static Eina_Bool 462static Eina_Bool
463_backlight_cb_mod_init_end(void *d EINA_UNUSED, int type EINA_UNUSED, void *ev EINA_UNUSED)
464{
465 Eina_List *l;
466 Instance *inst;
467
468 e_backlight_update();
469 EINA_LIST_FOREACH(backlight_instances, l, inst)
470 {
471 inst->val = e_backlight_level_get(inst->gcc->gadcon->zone);
472 _backlight_gadget_update(inst);
473 }
474 return ECORE_CALLBACK_RENEW;
475}
476
477static Eina_Bool
463_backlight_cb_changed(void *d EINA_UNUSED, int type EINA_UNUSED, void *ev EINA_UNUSED) 478_backlight_cb_changed(void *d EINA_UNUSED, int type EINA_UNUSED, void *ev EINA_UNUSED)
464{ 479{
465 Eina_List *l; 480 Eina_List *l;
@@ -485,7 +500,8 @@ e_modapi_init(E_Module *m)
485{ 500{
486 backlight_module = m; 501 backlight_module = m;
487 e_gadcon_provider_register(&_gadcon_class); 502 e_gadcon_provider_register(&_gadcon_class);
488 handler = ecore_event_handler_add(E_EVENT_BACKLIGHT_CHANGE, _backlight_cb_changed, NULL); 503 E_LIST_HANDLER_APPEND(handlers, E_EVENT_BACKLIGHT_CHANGE, _backlight_cb_changed, NULL);
504 E_LIST_HANDLER_APPEND(handlers, E_EVENT_MODULE_INIT_END, _backlight_cb_mod_init_end, NULL);
489 act = e_action_add("backlight"); 505 act = e_action_add("backlight");
490 if (act) 506 if (act)
491 { 507 {
@@ -504,8 +520,7 @@ e_modapi_shutdown(E_Module *m __UNUSED__)
504 e_action_del("backlight"); 520 e_action_del("backlight");
505 act = NULL; 521 act = NULL;
506 } 522 }
507 if (handler) handler = ecore_event_handler_del(handler); 523 E_FREE_LIST(handlers, ecore_event_handler_del);
508 backlight_module = NULL;
509 e_gadcon_provider_unregister(&_gadcon_class); 524 e_gadcon_provider_unregister(&_gadcon_class);
510 return 1; 525 return 1;
511} 526}