summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStafford Horne <shorne@gmail.com>2015-11-19 12:46:58 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-11-19 12:46:58 -0500
commit9bfd684e436ffc916d23ccbea2187d3240f74a7a (patch)
tree75a7d1c2da98bd532de82edd43c5af58117c2473
parent00252fad74dbe9d4d008201672233548d231fea9 (diff)
e/imc: fix issue with input method import segv and small window size
Summary: The imc import dialog at "Settings > Language > Input Method Settings > Import .." had issue where the size was almost zero. When trying to close the window it would SEGV. The SEGV seems to be do the with dialog->cdata not being set. The resize issue I am not so sure, but I upgraded to ELM and if fixed the issue. Test Plan: Open "Settings > Language > Input Method Settings > Import ..." - The size should not be really small - When closing it should not cause E to SEGV After applying the patch the above issues are fixed. Reviewers: zmike Subscribers: cedric, seoz Differential Revision: https://phab.enlightenment.org/D3353
-rw-r--r--src/modules/conf_intl/e_int_config_imc.c4
-rw-r--r--src/modules/conf_intl/e_int_config_imc_import.c38
2 files changed, 17 insertions, 25 deletions
diff --git a/src/modules/conf_intl/e_int_config_imc.c b/src/modules/conf_intl/e_int_config_imc.c
index 966ccfbda..d1b8f4a79 100644
--- a/src/modules/conf_intl/e_int_config_imc.c
+++ b/src/modules/conf_intl/e_int_config_imc.c
@@ -129,6 +129,7 @@ _create_data(E_Config_Dialog *cfd)
129 129
130 cfdata = E_NEW(E_Config_Dialog_Data, 1); 130 cfdata = E_NEW(E_Config_Dialog_Data, 1);
131 cfdata->cfd = cfd; 131 cfdata->cfd = cfd;
132 cfd->cfdata = cfdata;
132 _fill_data(cfdata); 133 _fill_data(cfdata);
133 return cfdata; 134 return cfdata;
134} 135}
@@ -146,8 +147,7 @@ _change_hash_free_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNU
146static void 147static void
147_free_data(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata) 148_free_data(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata)
148{ 149{
149 if (cfdata->win_import) 150 E_FREE_FUNC(cfdata->win_import, evas_object_del);
150 e_int_config_imc_import_del(cfdata->win_import);
151 eina_stringshare_del(cfdata->imc_current); 151 eina_stringshare_del(cfdata->imc_current);
152 152
153 if (cfdata->imc_basic_map) 153 if (cfdata->imc_basic_map)
diff --git a/src/modules/conf_intl/e_int_config_imc_import.c b/src/modules/conf_intl/e_int_config_imc_import.c
index aff37ad01..e9fdfd8ef 100644
--- a/src/modules/conf_intl/e_int_config_imc_import.c
+++ b/src/modules/conf_intl/e_int_config_imc_import.c
@@ -49,7 +49,7 @@ e_int_config_imc_import(E_Config_Dialog *parent)
49 import = E_NEW(Import, 1); 49 import = E_NEW(Import, 1);
50 if (!import) return NULL; 50 if (!import) return NULL;
51 51
52 win = elm_win_add(parent->parent, "E", ELM_WIN_BASIC); 52 win = elm_win_add(parent->parent, "E", ELM_WIN_DIALOG_BASIC);
53 if (!win) 53 if (!win)
54 { 54 {
55 E_FREE(import); 55 E_FREE(import);
@@ -67,16 +67,18 @@ e_int_config_imc_import(E_Config_Dialog *parent)
67 evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _imc_import_cb_delete, NULL); 67 evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _imc_import_cb_delete, NULL);
68 ecore_evas_name_class_set(ecore_evas_ecore_evas_get(evas_object_evas_get(win)), "E", "_imc_import_dialog"); 68 ecore_evas_name_class_set(ecore_evas_ecore_evas_get(evas_object_evas_get(win)), "E", "_imc_import_dialog");
69 69
70 o = edje_object_add(evas); 70 o = elm_layout_add(win);
71 elm_win_resize_object_add(win, o); 71 E_EXPAND(o);
72 E_FILL(o);
72 import->bg_obj = o; 73 import->bg_obj = o;
73 e_theme_edje_object_set(o, "base/theme/dialog", "e/widgets/dialog/main"); 74 e_theme_edje_object_set(o, "base/theme/dialog", "e/widgets/dialog/main");
75 elm_win_resize_object_add(win, o);
74 evas_object_show(o); 76 evas_object_show(o);
75 77
76 o = e_widget_list_add(evas, 1, 1); 78 o = e_widget_list_add(evas, 1, 1);
77 e_widget_on_focus_hook_set(o, _imc_import_cb_wid_focus, import); 79 e_widget_on_focus_hook_set(o, _imc_import_cb_wid_focus, import);
78 import->box_obj = o; 80 import->box_obj = o;
79 edje_object_part_swallow(import->bg_obj, "e.swallow.buttons", o); 81 elm_object_part_content_set(import->bg_obj, "e.swallow.buttons", o);
80 82
81 o = evas_object_rectangle_add(evas); 83 o = evas_object_rectangle_add(evas);
82 import->event_obj = o; 84 import->event_obj = o;
@@ -111,7 +113,7 @@ e_int_config_imc_import(E_Config_Dialog *parent)
111 113
112 e_widget_size_min_get(o, &w, &h); 114 e_widget_size_min_get(o, &w, &h);
113 evas_object_size_hint_min_set(o, w, h); 115 evas_object_size_hint_min_set(o, w, h);
114 edje_object_part_swallow(import->bg_obj, "e.swallow.content", o); 116 elm_object_part_content_set(import->bg_obj, "e.swallow.content", o);
115 evas_object_show(o); 117 evas_object_show(o);
116 118
117 import->ok_obj = e_widget_button_add(evas, _("OK"), NULL, 119 import->ok_obj = e_widget_button_add(evas, _("OK"), NULL,
@@ -129,13 +131,8 @@ e_int_config_imc_import(E_Config_Dialog *parent)
129 o = import->box_obj; 131 o = import->box_obj;
130 e_widget_size_min_get(o, &w, &h); 132 e_widget_size_min_get(o, &w, &h);
131 evas_object_size_hint_min_set(o, w, h); 133 evas_object_size_hint_min_set(o, w, h);
132 edje_object_part_swallow(import->bg_obj, "e.swallow.buttons", o); 134 elm_object_part_content_set(import->bg_obj, "e.swallow.buttons", o);
133 135
134 edje_object_size_min_calc(import->bg_obj, &w, &h);
135 evas_object_resize(import->bg_obj, w, h);
136 evas_object_resize(win, w, h);
137 evas_object_size_hint_min_set(win, w, h);
138 evas_object_size_hint_max_set(win, 99999, 99999);
139 evas_object_show(win); 136 evas_object_show(win);
140 e_win_client_icon_set(win, "preferences-imc"); 137 e_win_client_icon_set(win, "preferences-imc");
141 138
@@ -144,14 +141,15 @@ e_int_config_imc_import(E_Config_Dialog *parent)
144 return win; 141 return win;
145} 142}
146 143
147void 144static void
148e_int_config_imc_import_del(Evas_Object *win) 145_imc_import_cb_delete(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
149{ 146{
150 Import *import; 147 Import *import;
151 148
152 import = evas_object_data_get(win, "imc_win"); 149 import = evas_object_data_get(obj, "imc_win");
150 if (!import) return;
153 151
154 evas_object_del(win); 152 evas_object_del(import->win);
155 e_int_config_imc_import_done(import->parent); 153 e_int_config_imc_import_done(import->parent);
156 154
157 E_FREE(import->cfdata->file); 155 E_FREE(import->cfdata->file);
@@ -162,12 +160,6 @@ e_int_config_imc_import_del(Evas_Object *win)
162} 160}
163 161
164static void 162static void
165_imc_import_cb_delete(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
166{
167 e_int_config_imc_import_del(obj);
168}
169
170static void
171_imc_import_cb_wid_focus(void *data, Evas_Object *obj) 163_imc_import_cb_wid_focus(void *data, Evas_Object *obj)
172{ 164{
173 Import *import; 165 Import *import;
@@ -294,13 +286,13 @@ _imc_import_cb_ok(void *data, void *data2 EINA_UNUSED)
294 } 286 }
295 } 287 }
296 288
297 e_int_config_imc_import_del(import->win); 289 evas_object_del(import->win);
298} 290}
299 291
300static void 292static void
301_imc_import_cb_close(void *data, void *data2 EINA_UNUSED) 293_imc_import_cb_close(void *data, void *data2 EINA_UNUSED)
302{ 294{
303 e_int_config_imc_import_del(data); 295 evas_object_del(data);
304} 296}
305 297
306static void 298static void