From cb095be0cc5f3a2ca560dd1474a62bc7aa2a5a46 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 24 Mar 2019 08:44:12 +0530 Subject: [PATCH] Only update the selected text to clipboard when the selection is finished, not continuously as it is updated. Fixes #1460 Fixes #1492 --- docs/changelog.rst | 3 +++ kitty/mouse.c | 4 ++-- kitty/screen.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index a109b92d8..2892562cd 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -95,6 +95,9 @@ To update |kitty|, :doc:`follow the instructions `. characters after private use unicode characters to not be respected (:iss:`1455`) +- Only update the selected text to clipboard when the selection is finished, + not continuously as it is updated. (:iss:`1460`) + 0.13.3 [2019-01-19] ------------------------------ diff --git a/kitty/mouse.c b/kitty/mouse.c index 40581451a..4f00d84c9 100644 --- a/kitty/mouse.c +++ b/kitty/mouse.c @@ -203,7 +203,7 @@ static inline void extend_selection(Window *w) { Screen *screen = w->render_data.screen; if (screen_has_selection(screen)) { - screen_update_selection(screen, w->mouse_pos.cell_x, w->mouse_pos.cell_y, false); + screen_update_selection(screen, w->mouse_pos.cell_x, w->mouse_pos.cell_y, true); } } @@ -321,7 +321,7 @@ multi_click(Window *w, unsigned int count) { } if (found_selection) { screen_start_selection(screen, start, y1, false, mode); - screen_update_selection(screen, end, y2, false); + screen_update_selection(screen, end, y2, true); } } diff --git a/kitty/screen.c b/kitty/screen.c index 83fa5a925..49b06c328 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -2108,7 +2108,7 @@ screen_update_selection(Screen *self, index_type x, index_type y, bool ended) { case EXTEND_CELL: break; } - call_boss(set_primary_selection, NULL); + if (!self->selection.in_progress) call_boss(set_primary_selection, NULL); } static PyObject*