summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2015-06-11 23:55:35 +0200
committerBoris Faure <billiob@gmail.com>2015-06-11 23:55:35 +0200
commita07a63048c186780f83486c25f6c593165eee396 (patch)
treeb9440902efb20bfae075a53ecb79913304f87fe3 /src
parent1ad8055d286c1ca5f5f0b74accf90a4aebcb7a4b (diff)
fix crash from object being swallowed twice. Closes T2463
Diffstat (limited to 'src')
-rw-r--r--src/bin/termio.c33
-rw-r--r--src/bin/win.c48
2 files changed, 60 insertions, 21 deletions
diff --git a/src/bin/termio.c b/src/bin/termio.c
index f924a5b..e42f6a4 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -5311,6 +5311,39 @@ _smart_pty_cancel_sel(void *data)
5311static void 5311static void
5312_smart_pty_exited(void *data) 5312_smart_pty_exited(void *data)
5313{ 5313{
5314 Termio *sd = evas_object_smart_data_get(data);
5315
5316 if (sd->event)
5317 {
5318 evas_object_event_callback_del(sd->event, EVAS_CALLBACK_MOUSE_DOWN,
5319 _smart_cb_mouse_down);
5320 evas_object_event_callback_del(sd->event, EVAS_CALLBACK_MOUSE_UP,
5321 _smart_cb_mouse_up);
5322 evas_object_event_callback_del(sd->event, EVAS_CALLBACK_MOUSE_MOVE,
5323 _smart_cb_mouse_move);
5324 evas_object_event_callback_del(sd->event, EVAS_CALLBACK_MOUSE_IN,
5325 _smart_cb_mouse_in);
5326 evas_object_event_callback_del(sd->event, EVAS_CALLBACK_MOUSE_OUT,
5327 _smart_cb_mouse_out);
5328 evas_object_event_callback_del(sd->event, EVAS_CALLBACK_MOUSE_WHEEL,
5329 _smart_cb_mouse_wheel);
5330
5331 evas_object_del(sd->event);
5332 sd->event = NULL;
5333 }
5334 if (sd->self)
5335 {
5336 evas_object_event_callback_del(sd->self, EVAS_CALLBACK_KEY_DOWN,
5337 _smart_cb_key_down);
5338 evas_object_event_callback_del(sd->self, EVAS_CALLBACK_KEY_UP,
5339 _smart_cb_key_up);
5340 evas_object_event_callback_del(sd->self, EVAS_CALLBACK_FOCUS_IN,
5341 _smart_cb_focus_in);
5342 evas_object_event_callback_del(sd->self, EVAS_CALLBACK_FOCUS_OUT,
5343 _smart_cb_focus_out);
5344 sd->self = NULL;
5345 }
5346
5314 evas_object_smart_callback_call(data, "exited", NULL); 5347 evas_object_smart_callback_call(data, "exited", NULL);
5315} 5348}
5316 5349
diff --git a/src/bin/win.c b/src/bin/win.c
index 8b6b5c9..c94c2c0 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -161,11 +161,11 @@ static void _tabs_refresh(Tabs *tabs);
161/* {{{ Solo */ 161/* {{{ Solo */
162 162
163static Evas_Object * 163static Evas_Object *
164_solo_get_evas_object(Term_Container *container) 164_solo_get_evas_object(Term_Container *tc)
165{ 165{
166 Solo *solo; 166 Solo *solo;
167 assert (container->type == TERM_CONTAINER_TYPE_SOLO); 167 assert (tc->type == TERM_CONTAINER_TYPE_SOLO);
168 solo = (Solo*)container; 168 solo = (Solo*) tc;
169 169
170 return solo->term->bg; 170 return solo->term->bg;
171} 171}
@@ -782,7 +782,6 @@ _win_swallow(Term_Container *tc, Term_Container *orig,
782 Win *wn; 782 Win *wn;
783 Evas_Object *base; 783 Evas_Object *base;
784 Evas_Object *o; 784 Evas_Object *o;
785 Evas_Coord x, y, w, h;
786 785
787 assert (tc->type == TERM_CONTAINER_TYPE_WIN); 786 assert (tc->type == TERM_CONTAINER_TYPE_WIN);
788 787
@@ -791,16 +790,13 @@ _win_swallow(Term_Container *tc, Term_Container *orig,
791 790
792 if (orig) 791 if (orig)
793 { 792 {
794 o = edje_object_part_swallow_get(base, "terminology.content");
795 edje_object_part_unswallow(base, o);
796 evas_object_hide(o);
797 o = orig->get_evas_object(orig); 793 o = orig->get_evas_object(orig);
798 evas_object_geometry_get(o, &x, &y, &w, &h); 794 edje_object_part_unswallow(base, o);
799 } 795 }
796
800 o = new_child->get_evas_object(new_child); 797 o = new_child->get_evas_object(new_child);
801 edje_object_part_swallow(base, "terminology.content", o); 798 edje_object_part_swallow(base, "terminology.content", o);
802 if (orig) 799
803 evas_object_geometry_set(o, x, y, w, h);
804 evas_object_show(o); 800 evas_object_show(o);
805 new_child->parent = tc; 801 new_child->parent = tc;
806 wn->child = new_child; 802 wn->child = new_child;
@@ -893,8 +889,9 @@ _win_split(Term_Container *tc, Term_Container *child, const char *cmd,
893 Term *tm_new, *tm; 889 Term *tm_new, *tm;
894 Term_Container *tc_split, *tc_solo_new; 890 Term_Container *tc_split, *tc_solo_new;
895 Win *wn; 891 Win *wn;
896 Evas_Object *obj_split;
897 char buf[PATH_MAX], *wdir = NULL; 892 char buf[PATH_MAX], *wdir = NULL;
893 Evas_Object *base;
894 Evas_Object *o;
898 895
899 assert (tc->type == TERM_CONTAINER_TYPE_WIN); 896 assert (tc->type == TERM_CONTAINER_TYPE_WIN);
900 wn = (Win*) tc; 897 wn = (Win*) tc;
@@ -908,14 +905,14 @@ _win_split(Term_Container *tc, Term_Container *child, const char *cmd,
908 tc_solo_new = _solo_new(tm_new, wn); 905 tc_solo_new = _solo_new(tm_new, wn);
909 evas_object_data_set(tm_new->termio, "sizedone", tm_new->termio); 906 evas_object_data_set(tm_new->termio, "sizedone", tm_new->termio);
910 907
911 tc_split = _split_new(child, tc_solo_new, is_horizontal); 908 base = win_base_get(wn);
909 o = child->get_evas_object(child);
910 edje_object_part_unswallow(base, o);
912 911
913 obj_split = tc_split->get_evas_object(tc_split); 912 tc_split = _split_new(child, tc_solo_new, is_horizontal);
914 913
915 tc_split->is_focused = tc->is_focused; 914 tc_split->is_focused = tc->is_focused;
916 tc->swallow(tc, child, tc_split); 915 tc->swallow(tc, NULL, tc_split);
917
918 evas_object_show(obj_split);
919} 916}
920 917
921static void 918static void
@@ -1173,7 +1170,6 @@ _split_swallow(Term_Container *tc, Term_Container *orig,
1173{ 1170{
1174 Split *split; 1171 Split *split;
1175 Evas_Object *o; 1172 Evas_Object *o;
1176 Evas_Coord x, y, w, h;
1177 1173
1178 assert (tc->type == TERM_CONTAINER_TYPE_SPLIT); 1174 assert (tc->type == TERM_CONTAINER_TYPE_SPLIT);
1179 split = (Split*) tc; 1175 split = (Split*) tc;
@@ -1181,7 +1177,6 @@ _split_swallow(Term_Container *tc, Term_Container *orig,
1181 assert (orig && (orig == split->tc1 || orig == split->tc2)); 1177 assert (orig && (orig == split->tc1 || orig == split->tc2));
1182 1178
1183 o = orig->get_evas_object(orig); 1179 o = orig->get_evas_object(orig);
1184 evas_object_geometry_get(o, &x, &y, &w, &h);
1185 evas_object_hide(o); 1180 evas_object_hide(o);
1186 1181
1187 if (orig == split->last_focus) 1182 if (orig == split->last_focus)
@@ -1201,7 +1196,6 @@ _split_swallow(Term_Container *tc, Term_Container *orig,
1201 split->tc2 = new_child; 1196 split->tc2 = new_child;
1202 } 1197 }
1203 new_child->parent = tc; 1198 new_child->parent = tc;
1204 evas_object_geometry_set(o, x, y, w, h);
1205 evas_object_show(o); 1199 evas_object_show(o);
1206 evas_object_show(split->panes); 1200 evas_object_show(split->panes);
1207 1201
@@ -1253,12 +1247,15 @@ _split_close(Term_Container *tc, Term_Container *child)
1253{ 1247{
1254 Split *split; 1248 Split *split;
1255 Term_Container *parent, *other_child; 1249 Term_Container *parent, *other_child;
1250 Evas_Object *top, *bottom;
1256 1251
1257 assert (tc->type == TERM_CONTAINER_TYPE_SPLIT); 1252 assert (tc->type == TERM_CONTAINER_TYPE_SPLIT);
1258 split = (Split*) tc; 1253 split = (Split*) tc;
1259 1254
1260 elm_object_part_content_unset(split->panes, PANES_TOP); 1255 top = elm_object_part_content_unset(split->panes, PANES_TOP);
1261 elm_object_part_content_unset(split->panes, PANES_BOTTOM); 1256 bottom = elm_object_part_content_unset(split->panes, PANES_BOTTOM);
1257 evas_object_hide(top);
1258 evas_object_hide(bottom);
1262 1259
1263 parent = tc->parent; 1260 parent = tc->parent;
1264 other_child = (child == split->tc1) ? split->tc2 : split->tc1; 1261 other_child = (child == split->tc1) ? split->tc2 : split->tc1;
@@ -1360,11 +1357,13 @@ _split_split(Term_Container *tc, Term_Container *child,
1360{ 1357{
1361 Term *tm_new, *tm; 1358 Term *tm_new, *tm;
1362 Term_Container *tc_split, *tc_solo_new; 1359 Term_Container *tc_split, *tc_solo_new;
1360 Split *split;
1363 Win *wn; 1361 Win *wn;
1364 Evas_Object *obj_split; 1362 Evas_Object *obj_split;
1365 char buf[PATH_MAX], *wdir = NULL; 1363 char buf[PATH_MAX], *wdir = NULL;
1366 1364
1367 assert (tc->type == TERM_CONTAINER_TYPE_SPLIT); 1365 assert (tc->type == TERM_CONTAINER_TYPE_SPLIT);
1366 split = (Split *)tc;
1368 wn = tc->wn; 1367 wn = tc->wn;
1369 1368
1370 tm = child->focused_term_get(child); 1369 tm = child->focused_term_get(child);
@@ -1376,6 +1375,11 @@ _split_split(Term_Container *tc, Term_Container *child,
1376 tc_solo_new = _solo_new(tm_new, wn); 1375 tc_solo_new = _solo_new(tm_new, wn);
1377 evas_object_data_set(tm_new->termio, "sizedone", tm_new->termio); 1376 evas_object_data_set(tm_new->termio, "sizedone", tm_new->termio);
1378 1377
1378 if (child == split->tc1)
1379 elm_object_part_content_unset(split->panes, PANES_TOP);
1380 else
1381 elm_object_part_content_unset(split->panes, PANES_BOTTOM);
1382
1379 tc_split = _split_new(child, tc_solo_new, is_horizontal); 1383 tc_split = _split_new(child, tc_solo_new, is_horizontal);
1380 1384
1381 obj_split = tc_split->get_evas_object(tc_split); 1385 obj_split = tc_split->get_evas_object(tc_split);
@@ -3639,6 +3643,8 @@ _term_free(Term *term)
3639 term->popmedia_deleted = EINA_FALSE; 3643 term->popmedia_deleted = EINA_FALSE;
3640 evas_object_del(term->termio); 3644 evas_object_del(term->termio);
3641 term->termio = NULL; 3645 term->termio = NULL;
3646
3647 edje_object_part_unswallow(term->bg, term->base);
3642 evas_object_del(term->base); 3648 evas_object_del(term->base);
3643 term->base = NULL; 3649 term->base = NULL;
3644 evas_object_del(term->bg); 3650 evas_object_del(term->bg);