billiob pushed a commit to branch master. http://git.enlightenment.org/apps/terminology.git/commit/?id=561e1b09417551a1643849cc3f9cf3758e2a05f7
commit 561e1b09417551a1643849cc3f9cf3758e2a05f7 Author: Boris Faure <[email protected]> Date: Sun Dec 17 22:57:00 2017 +0100 splits: fix focus issue when splitting a split --- src/bin/win.c | 78 +++++++++++++++++++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/bin/win.c b/src/bin/win.c index 54f9dbd..ecebd5f 100644 --- a/src/bin/win.c +++ b/src/bin/win.c @@ -1232,7 +1232,7 @@ _cb_win_mouse_move(void *data, Evas_Event_Mouse_Move *ev = event; Term *term, *term_mouse; Term_Container *tc = (Term_Container*) wn; - Term_Container *tc_child; + Term_Container *tc_child = NULL; if (wn->group_input) return; @@ -1851,50 +1851,50 @@ _split_split(Term_Container *tc, Term_Container *child, { Split *split; Win *wn; + Term *tm_new, *tm; + char *wdir = NULL; + char buf[PATH_MAX]; + Term_Container *tc_split, *tc_solo_new; + Evas_Object *obj_split; + DBG(" "); assert (tc->type == TERM_CONTAINER_TYPE_SPLIT); split = (Split *)tc; wn = tc->wn; - if (_term_container_is_splittable(tc, is_horizontal)) - { - Term *tm_new, *tm; - char *wdir = NULL; - char buf[PATH_MAX]; - Term_Container *tc_split, *tc_solo_new; - Evas_Object *obj_split; - - // copy the current path to wdir if we should change the directory, - // passing wdir NULL otherwise: - if (wn->config->changedir_to_current) - { - if (from) - tm = from; - else - tm = child->focused_term_get(child); - if (tm && termio_cwd_get(tm->termio, buf, sizeof(buf))) - wdir = buf; - } - tm_new = term_new(wn, wn->config, - cmd, wn->config->login_shell, wdir, - 80, 24, EINA_FALSE, NULL); - tc_solo_new = _solo_new(tm_new, wn); - evas_object_data_set(tm_new->termio, "sizedone", tm_new->termio); + if (!_term_container_is_splittable(tc, is_horizontal)) + return; - if (child == split->tc1) - elm_object_part_content_unset(split->panes, PANES_TOP); + // copy the current path to wdir if we should change the directory, + // passing wdir NULL otherwise: + if (wn->config->changedir_to_current) + { + if (from) + tm = from; else - elm_object_part_content_unset(split->panes, PANES_BOTTOM); + tm = child->focused_term_get(child); + if (tm && termio_cwd_get(tm->termio, buf, sizeof(buf))) + wdir = buf; + } + tm_new = term_new(wn, wn->config, + cmd, wn->config->login_shell, wdir, + 80, 24, EINA_FALSE, NULL); + tc_solo_new = _solo_new(tm_new, wn); + evas_object_data_set(tm_new->termio, "sizedone", tm_new->termio); - tc_split = _split_new(child, tc_solo_new, is_horizontal); + if (child == split->tc1) + elm_object_part_content_unset(split->panes, PANES_TOP); + else + elm_object_part_content_unset(split->panes, PANES_BOTTOM); - obj_split = tc_split->get_evas_object(tc_split); + tc_split = _split_new(child, tc_solo_new, is_horizontal); - tc_split->is_focused = tc->is_focused; - tc->swallow(tc, child, tc_split); + obj_split = tc_split->get_evas_object(tc_split); - evas_object_show(obj_split); - } + tc_split->is_focused = tc->is_focused; + tc->swallow(tc, child, tc_split); + + evas_object_show(obj_split); } static Term_Container * @@ -1944,9 +1944,13 @@ _split_new(Term_Container *tc1, Term_Container *tc2, split->tc1 = tc1; split->tc2 = tc2; if (tc1->is_focused) - tc1->unfocus(tc1, tc); - tc2->focus(tc2, tc); - split->last_focus = tc2; + { + tc1->unfocus(tc1, tc); + tc2->focus(tc2, tc); + split->last_focus = tc2; + } + else + split->last_focus = tc1; o = split->panes = elm_panes_add(tc1->wn->win); elm_object_style_set(o, "flush"); --
