From c5a8531a91dd93ad5bf2391c314b0df41de0440a Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Fri, 3 Jan 2020 18:17:56 -0800 Subject: [PATCH] fix mouse cursor after changing the selection logic We weren't setting the cursor to an I-beam --- src/frontend/gui/termwindow.rs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/frontend/gui/termwindow.rs b/src/frontend/gui/termwindow.rs index 8292e4b0a..a8c8b0ce7 100644 --- a/src/frontend/gui/termwindow.rs +++ b/src/frontend/gui/termwindow.rs @@ -2462,6 +2462,15 @@ impl TermWindow { event: &MouseEvent, context: &dyn WindowOps, ) { + // TODO: track current_highlight for ourselves + context.set_cursor(Some(if tab.renderer().current_highlight().is_some() { + // When hovering over a hyperlink, show an appropriate + // mouse cursor to give the cue that it is clickable + MouseCursor::Hand + } else { + MouseCursor::Text + })); + if !tab.is_mouse_grabbed() || event.modifiers == Modifiers::SHIFT { let dims = tab.renderer().get_dimensions(); let stable_row = dims.physical_top + y as StableRowIndex; @@ -2521,6 +2530,8 @@ impl TermWindow { .as_ref() .unwrap() .set_clipboard(self.selection_text(&tab)); + tab.renderer().make_all_lines_dirty(); + context.invalidate(); } // Dragging left mouse button @@ -2631,15 +2642,6 @@ impl TermWindow { context.invalidate(); } } - - // TODO: track current_highlight for ourselves - context.set_cursor(Some(if tab.renderer().current_highlight().is_some() { - // When hovering over a hyperlink, show an appropriate - // mouse cursor to give the cue that it is clickable - MouseCursor::Hand - } else { - MouseCursor::Text - })); } }