diff options
author | Christian Duerr <contact@christianduerr.com> | 2020-06-18 01:02:56 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-18 01:02:56 +0000 |
commit | 87e5b1aa25ea61937fa5f79668d2a46e88707c5e (patch) | |
tree | 59205d2e00072a5f8737dc104f57fc940db0c2ec /alacritty/src/window.rs | |
parent | d526649ee67237a1bedad8228f1f017035ddad3f (diff) | |
download | r-alacritty-87e5b1aa25ea61937fa5f79668d2a46e88707c5e.tar.gz r-alacritty-87e5b1aa25ea61937fa5f79668d2a46e88707c5e.tar.bz2 r-alacritty-87e5b1aa25ea61937fa5f79668d2a46e88707c5e.zip |
Add automatic scrolling during selection
This adds a new `Scheduler` which allows for staging events to be
processed at a later time.
If there is a selection active and the mouse is above or below the
window, the viewport will now scroll torwards the direction of the
mouse. The amount of lines scrolled depends on the distance of the mouse
to the boundaries used for selection scrolling.
To make it possible to scroll while in fullscreen, the selection
scrolling area includes the padding of the window and is at least 5
pixels high in case there is not enough padding present.
Diffstat (limited to 'alacritty/src/window.rs')
-rw-r--r-- | alacritty/src/window.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/alacritty/src/window.rs b/alacritty/src/window.rs index 22e84780..4275f859 100644 --- a/alacritty/src/window.rs +++ b/alacritty/src/window.rs @@ -34,7 +34,6 @@ use glutin::{self, ContextBuilder, PossiblyCurrent, WindowedContext}; use winapi::shared::minwindef::WORD; use alacritty_terminal::config::{Decorations, StartupMode, WindowConfig}; -use alacritty_terminal::event::Event; #[cfg(not(windows))] use alacritty_terminal::term::{SizeInfo, Term}; @@ -103,9 +102,9 @@ impl From<font::Error> for Error { } } -fn create_gl_window( +fn create_gl_window<E>( mut window: WindowBuilder, - event_loop: &EventLoop<Event>, + event_loop: &EventLoop<E>, srgb: bool, vsync: bool, dimensions: Option<PhysicalSize<u32>>, @@ -147,8 +146,8 @@ impl Window { /// Create a new window. /// /// This creates a window and fully initializes a window. - pub fn new( - event_loop: &EventLoop<Event>, + pub fn new<E>( + event_loop: &EventLoop<E>, config: &Config, size: Option<PhysicalSize<u32>>, #[cfg(not(any(target_os = "macos", windows)))] wayland_event_queue: Option<&EventQueue>, |