aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2018-05-13 22:44:37 +0200
committerBoris Faure <billiob@gmail.com>2018-05-13 22:46:30 +0200
commit214ff03e361789025dc6eddcbe1a860d7437b3b0 (patch)
tree39becf8439b86624bcdaca27af1ed51ae6f8cac8
parentfix focus issue when mouse moving over window without focusing (diff)
downloadterminology-214ff03e361789025dc6eddcbe1a860d7437b3b0.tar.gz
win: do not force focus on mouse_down event if window is not (yet) focused
-rw-r--r--src/bin/win.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bin/win.c b/src/bin/win.c
index 7a93e0a..437d9fe 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -995,6 +995,7 @@ _win_focus(Term_Container *tc, Term_Container *relative)
tc, tc->is_focused, wn->child == relative);
if (relative != wn->child)
{
+ DBG("focus tc:%p", tc);
wn->child->focus(wn->child, tc);
elm_win_keyboard_mode_set(wn->win, ELM_WIN_KEYBOARD_TERMINAL);
if (wn->khdl.imf)
@@ -1542,6 +1543,10 @@ _cb_win_mouse_down(void *data,
if (wn->on_popover || wn->group_input)
return;
+ /* Focus In event will handle that */
+ if (!tc->is_focused)
+ return;
+
term_mouse = tc->find_term_at_coords(tc, ev->canvas.x, ev->canvas.y);
term = tc->focused_term_get(tc);
if (term_mouse == term)
@@ -1554,6 +1559,7 @@ _cb_win_mouse_down(void *data,
}
tc_child = term_mouse->container;
+ DBG("focus tc_child:%p", tc_child);
tc_child->focus(tc_child, tc);
}