From fd2515da5c30af1c31e3140ede20f76fba5092cf Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Tue, 2 Apr 2019 19:36:26 -0400 Subject: [PATCH] Do not focus window when mouse button is released It is useless to focus a window on mouse button release. This behaviour makes this scenario possible: 1. Have at least two visible windows in the current tab. 2. Select text in a window with the left mouse button, dragging, and release the mouse button within the other window. The focus is changed to the other window. I believe this is unexpected. Signed-off-by: Philippe Proulx --- kitty/mouse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kitty/mouse.c b/kitty/mouse.c index 4f00d84c9..23e0f81e6 100644 --- a/kitty/mouse.c +++ b/kitty/mouse.c @@ -372,7 +372,7 @@ open_url(Window *w) { HANDLER(handle_button_event) { Tab *t = global_state.callback_os_window->tabs + global_state.callback_os_window->active_tab; bool is_release = !global_state.callback_os_window->mouse_button_pressed[button]; - if (window_idx != t->active_window) { + if (window_idx != t->active_window && !is_release) { call_boss(switch_focus_to, "I", window_idx); } Screen *screen = w->render_data.screen;