summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorChristopher Michael <cp.michael@samsung.com>2018-11-29 14:09:09 -0500
committerChristopher Michael <cp.michael@samsung.com>2018-11-29 14:35:26 -0500
commiteec7bc458eee333fd7237a3bd43e8c2c884f21ca (patch)
treeb66c1cdebad25fcef8d888e8860030adaeb90c7c /src/lib/elementary
parentbe7d76ece63844f1967ee12d042c920a8540ab4a (diff)
elementary: Support using no frame object
Summary: Creation of the frame object can lead to significant delays in window creation time on limited-power devices (watches, mobile, tv, etc). This patch allows setting an environment variable and config value in order to completely skip frame object creation. This shaves about 50ms from startup on an i7 8600k, so should be more substantial a saves on limited-power devices. Reviewers: kimcinoo, ManMower Reviewed By: ManMower Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7305
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/efl_ui_win.c33
-rw-r--r--src/lib/elementary/elm_config.c11
-rw-r--r--src/lib/elementary/elm_priv.h6
3 files changed, 42 insertions, 8 deletions
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 712238e04b..535316119e 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -4623,7 +4623,8 @@ _elm_win_frame_style_update(Efl_Ui_Win_Data *sd, Eina_Bool force_emit, Eina_Bool
4623 if (!efl_finalized_get(sd->obj)) return; 4623 if (!efl_finalized_get(sd->obj)) return;
4624 if (EINA_LIKELY(sd->type == ELM_WIN_FAKE)) 4624 if (EINA_LIKELY(sd->type == ELM_WIN_FAKE))
4625 return; 4625 return;
4626 CRI("Window has no frame object!"); 4626 if (!_elm_config->win_no_border)
4627 CRI("Window has no frame object!");
4627 return; 4628 return;
4628 } 4629 }
4629 4630
@@ -4640,6 +4641,8 @@ _elm_win_frame_style_update(Efl_Ui_Win_Data *sd, Eina_Bool force_emit, Eina_Bool
4640 sd->csd.need_menu = EINA_FALSE; 4641 sd->csd.need_menu = EINA_FALSE;
4641 sd->csd.need_indicator = EINA_FALSE; 4642 sd->csd.need_indicator = EINA_FALSE;
4642 } 4643 }
4644 else if (_elm_config->win_no_border)
4645 sd->csd.need_borderless = EINA_TRUE;
4643 else 4646 else
4644 { 4647 {
4645 sd->csd.need_shadow = sd->csd.need && (!sd->maximized); 4648 sd->csd.need_shadow = sd->csd.need && (!sd->maximized);
@@ -5606,7 +5609,9 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U
5606 case EFL_UI_WIN_NAVIFRAME_BASIC: element = "naviframe"; break; 5609 case EFL_UI_WIN_NAVIFRAME_BASIC: element = "naviframe"; break;
5607 default: break; 5610 default: break;
5608 } 5611 }
5609 _elm_win_frame_add(sd, element, style); 5612
5613 if (!_elm_config->win_no_border)
5614 _elm_win_frame_add(sd, element, style);
5610 5615
5611 if (sd->indimode != EFL_UI_WIN_INDICATOR_OFF) 5616 if (sd->indimode != EFL_UI_WIN_INDICATOR_OFF)
5612 _indicator_add(sd); 5617 _indicator_add(sd);
@@ -7330,13 +7335,29 @@ _elm_win_bg_set(Efl_Ui_Win_Data *sd, Eo *bg)
7330 return EINA_FALSE; 7335 return EINA_FALSE;
7331 if (elm_widget_is_legacy(sd->obj)) 7336 if (elm_widget_is_legacy(sd->obj))
7332 { 7337 {
7333 if (!edje_object_part_swallow(sd->frame_obj, "elm.swallow.background", bg)) 7338 if (!_elm_config->win_no_border)
7334 return EINA_FALSE; 7339 {
7340 if (!edje_object_part_swallow(sd->frame_obj, "elm.swallow.background", bg))
7341 return EINA_FALSE;
7342 }
7343 else
7344 {
7345 if (!edje_object_part_swallow(sd->legacy.edje, "elm.swallow.background", bg))
7346 return EINA_FALSE;
7347 }
7335 } 7348 }
7336 else 7349 else
7337 { 7350 {
7338 if (!edje_object_part_swallow(sd->frame_obj, "efl.background", bg)) 7351 if (!_elm_config->win_no_border)
7339 return EINA_FALSE; 7352 {
7353 if (!edje_object_part_swallow(sd->frame_obj, "efl.background", bg))
7354 return EINA_FALSE;
7355 }
7356 else
7357 {
7358 if (!edje_object_part_swallow(sd->legacy.edje, "efl.background", bg))
7359 return EINA_FALSE;
7360 }
7340 } 7361 }
7341 efl_gfx_entity_visible_set(bg, 1); 7362 efl_gfx_entity_visible_set(bg, 1);
7342 efl_gfx_size_hint_align_set(bg, -1, -1); 7363 efl_gfx_size_hint_align_set(bg, -1, -1);
diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c
index 13e80fd5da..6102ec6dcb 100644
--- a/src/lib/elementary/elm_config.c
+++ b/src/lib/elementary/elm_config.c
@@ -535,6 +535,7 @@ _desc_init(void)
535 ELM_CONFIG_VAL(D, T, offline, T_UCHAR); 535 ELM_CONFIG_VAL(D, T, offline, T_UCHAR);
536 ELM_CONFIG_VAL(D, T, powersave, T_INT); 536 ELM_CONFIG_VAL(D, T, powersave, T_INT);
537 ELM_CONFIG_VAL(D, T, drag_anim_duration, T_DOUBLE); 537 ELM_CONFIG_VAL(D, T, drag_anim_duration, T_DOUBLE);
538 ELM_CONFIG_VAL(D, T, win_no_border, T_UCHAR);
538#undef T 539#undef T
539#undef D 540#undef D
540#undef T_INT 541#undef T_INT
@@ -1868,6 +1869,7 @@ _config_load(Eina_Bool on_flush)
1868 _elm_config->popup_scrollable = EINA_FALSE; 1869 _elm_config->popup_scrollable = EINA_FALSE;
1869 _elm_config->entry_select_allow = EINA_TRUE; 1870 _elm_config->entry_select_allow = EINA_TRUE;
1870 _elm_config->drag_anim_duration = 0.0; 1871 _elm_config->drag_anim_duration = 0.0;
1872 _elm_config->win_no_border = EINA_FALSE;
1871 _env_get(); 1873 _env_get();
1872} 1874}
1873 1875
@@ -2077,6 +2079,8 @@ _elm_config_reload_do(Eina_Bool on_flush)
2077 KEEP_VAL(entry_select_allow); 2079 KEEP_VAL(entry_select_allow);
2078 KEEP_VAL(drag_anim_duration); 2080 KEEP_VAL(drag_anim_duration);
2079 2081
2082 KEEP_VAL(win_no_border);
2083
2080 _elm_config->priv = prev_config->priv; 2084 _elm_config->priv = prev_config->priv;
2081 _config_free(prev_config); 2085 _config_free(prev_config);
2082 } 2086 }
@@ -2516,6 +2520,10 @@ _config_update(void)
2516 _elm_key_bindings_update(_elm_config, tcfg); 2520 _elm_key_bindings_update(_elm_config, tcfg);
2517 IFCFGEND 2521 IFCFGEND
2518 2522
2523 IFCFG(0x0010)
2524 _elm_config->win_no_border = EINA_FALSE;
2525 IFCFGEND
2526
2519 /** 2527 /**
2520 * Fix user config for current ELM_CONFIG_EPOCH here. 2528 * Fix user config for current ELM_CONFIG_EPOCH here.
2521 **/ 2529 **/
@@ -2892,6 +2900,9 @@ _env_get(void)
2892 2900
2893 s = getenv("EFL_UI_DND_DRAG_ANIM_DURATION"); 2901 s = getenv("EFL_UI_DND_DRAG_ANIM_DURATION");
2894 if (s) _elm_config->drag_anim_duration = _elm_atof(s); 2902 if (s) _elm_config->drag_anim_duration = _elm_atof(s);
2903
2904 s = getenv("ELM_WIN_NO_BORDER");
2905 if (s) _elm_config->win_no_border = EINA_TRUE;
2895} 2906}
2896 2907
2897static void 2908static void
diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h
index 0c34917b88..6b181e8ffb 100644
--- a/src/lib/elementary/elm_priv.h
+++ b/src/lib/elementary/elm_priv.h
@@ -166,8 +166,8 @@ struct _Efl_Ui_Theme_Data
166 * the users config doesn't need to be wiped - simply new values need 166 * the users config doesn't need to be wiped - simply new values need
167 * to be put in 167 * to be put in
168 */ 168 */
169# define ELM_CONFIG_FILE_GENERATION 0x0012 169# define ELM_CONFIG_FILE_GENERATION 0x0013
170# define ELM_CONFIG_VERSION_EPOCH_OFFSET 16 170# define ELM_CONFIG_VERSION_EPOCH_OFFSET 17
171# define ELM_CONFIG_VERSION ((ELM_CONFIG_EPOCH << ELM_CONFIG_VERSION_EPOCH_OFFSET) | \ 171# define ELM_CONFIG_VERSION ((ELM_CONFIG_EPOCH << ELM_CONFIG_VERSION_EPOCH_OFFSET) | \
172 ELM_CONFIG_FILE_GENERATION) 172 ELM_CONFIG_FILE_GENERATION)
173/* NB: profile configuration files (.src) must have their 173/* NB: profile configuration files (.src) must have their
@@ -353,6 +353,7 @@ struct _Elm_Config_Flags
353 Eina_Bool icon_theme : 1; 353 Eina_Bool icon_theme : 1;
354 Eina_Bool entry_select_allow : 1; // unused 354 Eina_Bool entry_select_allow : 1; // unused
355 Eina_Bool drag_anim_duration : 1; 355 Eina_Bool drag_anim_duration : 1;
356 Eina_Bool win_no_border : 1;
356}; 357};
357 358
358struct _Elm_Config 359struct _Elm_Config
@@ -498,6 +499,7 @@ struct _Elm_Config
498 Eina_Bool offline; 499 Eina_Bool offline;
499 int powersave; 500 int powersave;
500 double drag_anim_duration; 501 double drag_anim_duration;
502 unsigned char win_no_border;
501 503
502 /* Not part of the EET file */ 504 /* Not part of the EET file */
503 Eina_Bool is_mirrored : 1; 505 Eina_Bool is_mirrored : 1;