summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2020-10-17 17:03:56 +0200
committerBoris Faure <billiob@gmail.com>2020-10-17 17:03:56 +0200
commit28d94caad93035698a40e7ced0cecc314c2691cd (patch)
treeec1eb78115dd13206b7c102381482f17466d232e
parenta05db782395468d0871c59be99646bf44351c9c2 (diff)
win: cleanup focus. Closes T8756terminology-1.8
-rw-r--r--src/bin/win.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/bin/win.c b/src/bin/win.c
index 5b49bad..2cd86b7 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -2767,6 +2767,7 @@ _split_focus(Term_Container *tc, Term_Container *relative)
2767 2767
2768 if (tc->parent == relative) 2768 if (tc->parent == relative)
2769 { 2769 {
2770 /* top to bottom */
2770 if (!tc->is_focused) 2771 if (!tc->is_focused)
2771 { 2772 {
2772 Term_Container *last_focus = split->last_focus; 2773 Term_Container *last_focus = split->last_focus;
@@ -2780,11 +2781,13 @@ _split_focus(Term_Container *tc, Term_Container *relative)
2780 } 2781 }
2781 else 2782 else
2782 { 2783 {
2784 /* bottom to top */
2783 if (split->last_focus != relative) 2785 if (split->last_focus != relative)
2784 split->last_focus->unfocus(split->last_focus, tc); 2786 split->last_focus->unfocus(split->last_focus, tc);
2785 split->last_focus = relative; 2787 split->last_focus = relative;
2786 if (!tc->is_focused) 2788 if (!tc->is_focused)
2787 { 2789 {
2790 /* was not focused, bring focus up */
2788 tc->is_focused = EINA_TRUE; 2791 tc->is_focused = EINA_TRUE;
2789 tc->parent->focus(tc->parent, tc); 2792 tc->parent->focus(tc->parent, tc);
2790 } 2793 }
@@ -2900,7 +2903,7 @@ _split_split(Term_Container *tc, Term_Container *child,
2900 _solo_tab_show(tc_solo_new); 2903 _solo_tab_show(tc_solo_new);
2901 } 2904 }
2902 2905
2903 tc_split->is_focused = EINA_TRUE; 2906 child->unfocus(child, tc_split);
2904 tc_split->focus(tc_split, tc_solo_new); 2907 tc_split->focus(tc_split, tc_solo_new);
2905 tc_solo_new->focus(tc_solo_new, tc_split); 2908 tc_solo_new->focus(tc_solo_new, tc_split);
2906 2909
@@ -3009,7 +3012,9 @@ _split_new(Term_Container *tc1, Term_Container *tc2,
3009 return NULL; 3012 return NULL;
3010 } 3013 }
3011 3014
3012 DBG("split new %p 1:%p 2:%p", split, tc1, tc2); 3015 DBG("split new %p 1:%p 2:%p (1 is %sfocused) (2 is %sfocused)", split, tc1, tc2,
3016 tc1->is_focused ? "" : "not ",
3017 tc2->is_focused ? "" : "not ");
3013 3018
3014 tc = (Term_Container*)split; 3019 tc = (Term_Container*)split;
3015 tc->term_next = _split_term_next; 3020 tc->term_next = _split_term_next;