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 <eeppeliteloop@gmail.com>
This commit is contained in:
Philippe Proulx 2019-04-02 19:36:26 -04:00
parent 96f5c66755
commit fd2515da5c

View File

@ -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;