From ea9af96d2bc53804d352c47ce2a6751531ebbff8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 22 Sep 2018 18:15:03 +0530 Subject: [PATCH] Fix using `focus_follows_mouse` causing text selection with the mouse to malfunction when using multiple kitty windows Fixes #1002 --- docs/changelog.rst | 3 +++ kitty/mouse.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index b4e849b52..0cc7c257c 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -67,6 +67,9 @@ Changelog - Remote control: Fix the ``focus_window`` command not focusing the top-level OS window of the specified kitty window (:iss:`1003`) +- Fix using :opt:`focus_follows_mouse` causing text selection with the + mouse to malfunction when using multiple kitty windows (:iss:`1002`) + 0.12.1 [2018-09-08] ------------------------------ diff --git a/kitty/mouse.c b/kitty/mouse.c index 078cbfb16..b5b67d2a7 100644 --- a/kitty/mouse.c +++ b/kitty/mouse.c @@ -497,6 +497,8 @@ mouse_event(int button, int modifiers, int action) { button = currently_pressed_button(); if (button == GLFW_MOUSE_BUTTON_LEFT) { clamp_to_window = true; + Tab *t = global_state.callback_os_window->tabs + global_state.callback_os_window->active_tab; + for (window_idx = 0; window_idx < t->num_windows && t->windows[window_idx].id != w->id; window_idx++); handle_move_event(w, button, modifiers, window_idx); clamp_to_window = false; return;