summaryrefslogtreecommitdiff
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
parent6694266a3ddc784c21c6fa7ee0ab57e8bc201e5a (diff)
win: do not force focus on mouse_down event if window is not (yet) focused
Refs: T6882
-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)
995 tc, tc->is_focused, wn->child == relative); 995 tc, tc->is_focused, wn->child == relative);
996 if (relative != wn->child) 996 if (relative != wn->child)
997 { 997 {
998 DBG("focus tc:%p", tc);
998 wn->child->focus(wn->child, tc); 999 wn->child->focus(wn->child, tc);
999 elm_win_keyboard_mode_set(wn->win, ELM_WIN_KEYBOARD_TERMINAL); 1000 elm_win_keyboard_mode_set(wn->win, ELM_WIN_KEYBOARD_TERMINAL);
1000 if (wn->khdl.imf) 1001 if (wn->khdl.imf)
@@ -1542,6 +1543,10 @@ _cb_win_mouse_down(void *data,
1542 if (wn->on_popover || wn->group_input) 1543 if (wn->on_popover || wn->group_input)
1543 return; 1544 return;
1544 1545
1546 /* Focus In event will handle that */
1547 if (!tc->is_focused)
1548 return;
1549
1545 term_mouse = tc->find_term_at_coords(tc, ev->canvas.x, ev->canvas.y); 1550 term_mouse = tc->find_term_at_coords(tc, ev->canvas.x, ev->canvas.y);
1546 term = tc->focused_term_get(tc); 1551 term = tc->focused_term_get(tc);
1547 if (term_mouse == term) 1552 if (term_mouse == term)
@@ -1554,6 +1559,7 @@ _cb_win_mouse_down(void *data,
1554 } 1559 }
1555 1560
1556 tc_child = term_mouse->container; 1561 tc_child = term_mouse->container;
1562 DBG("focus tc_child:%p", tc_child);
1557 tc_child->focus(tc_child, tc); 1563 tc_child->focus(tc_child, tc);
1558} 1564}
1559 1565