mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-25 14:05:41 -05:00
Fix selection copy without button release
To prevent the current selection clipboard from being overwritten right before pasting, text is no longer copied solely because the user scrolled the scrollback buffer. The selection also isn't copied when a mouse button other than LMB/RMB are released, since these are the only ones capable of modifying the selection range. This should prevent issues where the selection of the user gets unexpectedly overwritten, especially in scenarios where the user is currently in the process of pasting something into Alacritty. Signed-off-by: Julian Orth <ju.orth@gmail.com>
This commit is contained in:
parent
d5cad2a862
commit
9bbb296d1d
3 changed files with 5 additions and 3 deletions
|
@ -33,6 +33,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
- Failure when running on 10-bit color system
|
- Failure when running on 10-bit color system
|
||||||
- The colors being slightly different when using srgb displays on macOS
|
- The colors being slightly different when using srgb displays on macOS
|
||||||
- Vi cursor blinking not reset when navigating in search
|
- Vi cursor blinking not reset when navigating in search
|
||||||
|
- Scrolling and middle-clicking modifying the primary selection
|
||||||
|
|
||||||
## 0.10.1
|
## 0.10.1
|
||||||
|
|
||||||
|
|
|
@ -233,7 +233,6 @@ impl<'a, N: Notify + 'a, T: EventListener> input::ActionContext<T> for ActionCon
|
||||||
let point = self.mouse.point(&self.size_info(), display_offset);
|
let point = self.mouse.point(&self.size_info(), display_offset);
|
||||||
self.update_selection(point, self.mouse.cell_side);
|
self.update_selection(point, self.mouse.cell_side);
|
||||||
}
|
}
|
||||||
self.copy_selection(ClipboardType::Selection);
|
|
||||||
|
|
||||||
*self.dirty = true;
|
*self.dirty = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -614,8 +614,10 @@ impl<T: EventListener, A: ActionContext<T>> Processor<T, A> {
|
||||||
let timer_id = TimerId::new(Topic::SelectionScrolling, self.ctx.window().id());
|
let timer_id = TimerId::new(Topic::SelectionScrolling, self.ctx.window().id());
|
||||||
self.ctx.scheduler_mut().unschedule(timer_id);
|
self.ctx.scheduler_mut().unschedule(timer_id);
|
||||||
|
|
||||||
// Copy selection on release, to prevent flooding the display server.
|
if let MouseButton::Left | MouseButton::Right = button {
|
||||||
self.ctx.copy_selection(ClipboardType::Selection);
|
// Copy selection on release, to prevent flooding the display server.
|
||||||
|
self.ctx.copy_selection(ClipboardType::Selection);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn mouse_wheel_input(&mut self, delta: MouseScrollDelta, phase: TouchPhase) {
|
pub fn mouse_wheel_input(&mut self, delta: MouseScrollDelta, phase: TouchPhase) {
|
||||||
|
|
Loading…
Reference in a new issue