From: Wonki Kim Date: Thu, 17 Aug 2017 01:49:40 +0000 (+0900) Subject: elm_conform: Prevent infinite trial of connection to the indicator X-Git-Tag: submit/tizen_3.0/20170825.055425~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a76661ca2642d578ee51a044ff7611b8cc4c4b61;p=platform%2Fupstream%2Felementary.git elm_conform: Prevent infinite trial of connection to the indicator Even if there isn't a indicator at all, the conformant tries to connect to the indicator server INFINITELY. Therefore that makes wasting of computing power. This patch prevents the trials to save computing power. @tizen_fix Change-Id: I2ec5034bae969f13f49babbf3900aaa74390a471 Signed-off-by: Wonki Kim --- diff --git a/src/lib/elm_conform.c b/src/lib/elm_conform.c index 5f980531b..634889723 100644 --- a/src/lib/elm_conform.c +++ b/src/lib/elm_conform.c @@ -17,6 +17,9 @@ //TIZEN_ONLY(20160330): add processing properties of window #define SWAP(x, y, t) ((t) = (x), (x) = (y), (y) = (t)) // +//TIZEN_ONLY(20170817) : Prevent infinite trial of connection to the indicator server +#define CONNECT_TRY_MAX (3) +//END static char CONFORMANT_KEY[] = "_elm_conform_key"; @@ -608,6 +611,16 @@ _indicator_connect_cb(void *data) ELM_CONFORMANT_DATA_GET(data, sd); if (!sd) return ECORE_CALLBACK_CANCEL; + + //TIZEN_ONLY(20170817) : Prevent infinite trial of connection to the indicator server + if(++sd->connect_try > CONNECT_TRY_MAX) + { + DBG("Conformant tried to connect to indicator %d times but give up now", CONNECT_TRY_MAX); + sd->indi_timer = NULL; + return ECORE_CALLBACK_CANCEL; + } + //END + if (sd->indmode != ELM_WIN_INDICATOR_SHOW) { sd->indi_timer = NULL; @@ -834,6 +847,9 @@ _create_indicator(Evas_Object *obj) evas_object_size_hint_min_set(indicator, -1, 0); evas_object_size_hint_max_set(indicator, -1, 0); + //TIZEN_ONLY(20170817) : Prevent infinite trial of connection to the indicator server + sd->connect_try = 1; + //END return indicator; } //END diff --git a/src/lib/elm_widget_conform.h b/src/lib/elm_widget_conform.h index 6b50b5b7d..5a9342280 100644 --- a/src/lib/elm_widget_conform.h +++ b/src/lib/elm_widget_conform.h @@ -63,6 +63,9 @@ struct _Elm_Conformant_Data int rot; Evas_Object *indicator; Ecore_Timer *indi_timer; + //TIZEN_ONLY(20170817) : Prevent infinite trial of connection to the indicator server + int connect_try; + //END }; /* Enum to identify conformant swallow parts */