From f98a8e82d2fb4b9a5385dd0403b94e47587fe42a Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Tue, 20 Apr 2021 10:15:50 +0100 Subject: [PATCH] clock - save some power and send freeze to clock when screen is blanked don't tick quietly in the background when screen is off. no point --- src/modules/clock/e_mod_main.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/modules/clock/e_mod_main.c b/src/modules/clock/e_mod_main.c index 0923423f5..a6a6bcc36 100644 --- a/src/modules/clock/e_mod_main.c +++ b/src/modules/clock/e_mod_main.c @@ -845,6 +845,15 @@ _clock_time_update(void *d EINA_UNUSED, int type EINA_UNUSED, void *event EINA_U static Eina_Bool _clock_screensaver_on() { + Eina_List *l; + Instance *inst; + + EINA_LIST_FOREACH(clock_instances, l, inst) + { + edje_object_signal_emit(inst->o_clock, "e,state,freeze", "e"); + if (inst->o_popclock) + edje_object_signal_emit(inst->o_popclock, "e,state,freeze", "e"); + } E_FREE_FUNC(update_today, ecore_timer_del); return ECORE_CALLBACK_RENEW; } @@ -852,6 +861,15 @@ _clock_screensaver_on() static Eina_Bool _clock_screensaver_off() { + Eina_List *l; + Instance *inst; + + EINA_LIST_FOREACH(clock_instances, l, inst) + { + edje_object_signal_emit(inst->o_clock, "e,state,thaw", "e"); + if (inst->o_popclock) + edje_object_signal_emit(inst->o_popclock, "e,state,thaw", "e"); + } if (clock_instances) _update_today_timer(NULL); return ECORE_CALLBACK_RENEW; }