aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/input.rs
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2022-11-03 19:37:54 +0300
committerGitHub <noreply@github.com>2022-11-03 19:37:54 +0300
commit0e418bc2f761617455cc58aaabc375055dfe4284 (patch)
treefc15d2260404914e21297d392f7f9c32a5f2bffc /alacritty/src/input.rs
parent578e08486dfcdee0b2cd0e7a66752ff50edc46b8 (diff)
downloadr-alacritty-0e418bc2f761617455cc58aaabc375055dfe4284.tar.gz
r-alacritty-0e418bc2f761617455cc58aaabc375055dfe4284.tar.bz2
r-alacritty-0e418bc2f761617455cc58aaabc375055dfe4284.zip
Update glutin to 0.30.0
The glutin 0.30.0 update decouples glutin from winit which provides us with basis for a multithreaded renderer. This also improves robustness of our configuration picking, context creation, and surface handling. As an example we're now able to start on systems without a vsync, we don't try to build lots of contexts to check if some config works, and so on. That also brings us possibility to handle context losses, but that's a future work. Fixes #1268.
Diffstat (limited to 'alacritty/src/input.rs')
-rw-r--r--alacritty/src/input.rs34
1 files changed, 17 insertions, 17 deletions
diff --git a/alacritty/src/input.rs b/alacritty/src/input.rs
index 6dbb72cf..c8d948ff 100644
--- a/alacritty/src/input.rs
+++ b/alacritty/src/input.rs
@@ -1,4 +1,4 @@
-//! Handle input from glutin.
+//! Handle input from winit.
//!
//! Certain key combinations should send some escape sequence back to the PTY.
//! In order to figure that out, state about which modifier keys are pressed
@@ -12,14 +12,14 @@ use std::fmt::Debug;
use std::marker::PhantomData;
use std::time::{Duration, Instant};
-use glutin::dpi::PhysicalPosition;
-use glutin::event::{
+use winit::dpi::PhysicalPosition;
+use winit::event::{
ElementState, KeyboardInput, ModifiersState, MouseButton, MouseScrollDelta, TouchPhase,
};
-use glutin::event_loop::EventLoopWindowTarget;
+use winit::event_loop::EventLoopWindowTarget;
#[cfg(target_os = "macos")]
-use glutin::platform::macos::EventLoopWindowTargetExtMacOS;
-use glutin::window::CursorIcon;
+use winit::platform::macos::EventLoopWindowTargetExtMacOS;
+use winit::window::CursorIcon;
use alacritty_terminal::ansi::{ClearMode, Handler};
use alacritty_terminal::event::EventListener;
@@ -51,7 +51,7 @@ const MIN_SELECTION_SCROLLING_HEIGHT: f64 = 5.;
/// Number of pixels for increasing the selection scrolling speed factor by one.
const SELECTION_SCROLLING_STEP: f64 = 20.;
-/// Processes input from glutin.
+/// Processes input from winit.
///
/// An escape sequence may be emitted in case specific keys or key combinations
/// are activated.
@@ -990,8 +990,8 @@ impl<T: EventListener, A: ActionContext<T>> Processor<T, A> {
mod tests {
use super::*;
- use glutin::event::{DeviceId, Event as GlutinEvent, VirtualKeyCode, WindowEvent};
- use glutin::window::WindowId;
+ use winit::event::{DeviceId, Event as WinitEvent, VirtualKeyCode, WindowEvent};
+ use winit::window::WindowId;
use alacritty_terminal::event::Event as TerminalEvent;
@@ -1158,8 +1158,8 @@ mod tests {
let mut processor = Processor::new(context);
- let event: GlutinEvent::<'_, TerminalEvent> = $input;
- if let GlutinEvent::WindowEvent {
+ let event: WinitEvent::<'_, TerminalEvent> = $input;
+ if let WinitEvent::WindowEvent {
event: WindowEvent::MouseInput {
state,
button,
@@ -1199,7 +1199,7 @@ mod tests {
name: single_click,
initial_state: ClickState::None,
initial_button: MouseButton::Other(0),
- input: GlutinEvent::WindowEvent {
+ input: WinitEvent::WindowEvent {
event: WindowEvent::MouseInput {
state: ElementState::Pressed,
button: MouseButton::Left,
@@ -1215,7 +1215,7 @@ mod tests {
name: single_right_click,
initial_state: ClickState::None,
initial_button: MouseButton::Other(0),
- input: GlutinEvent::WindowEvent {
+ input: WinitEvent::WindowEvent {
event: WindowEvent::MouseInput {
state: ElementState::Pressed,
button: MouseButton::Right,
@@ -1231,7 +1231,7 @@ mod tests {
name: single_middle_click,
initial_state: ClickState::None,
initial_button: MouseButton::Other(0),
- input: GlutinEvent::WindowEvent {
+ input: WinitEvent::WindowEvent {
event: WindowEvent::MouseInput {
state: ElementState::Pressed,
button: MouseButton::Middle,
@@ -1247,7 +1247,7 @@ mod tests {
name: double_click,
initial_state: ClickState::Click,
initial_button: MouseButton::Left,
- input: GlutinEvent::WindowEvent {
+ input: WinitEvent::WindowEvent {
event: WindowEvent::MouseInput {
state: ElementState::Pressed,
button: MouseButton::Left,
@@ -1263,7 +1263,7 @@ mod tests {
name: triple_click,
initial_state: ClickState::DoubleClick,
initial_button: MouseButton::Left,
- input: GlutinEvent::WindowEvent {
+ input: WinitEvent::WindowEvent {
event: WindowEvent::MouseInput {
state: ElementState::Pressed,
button: MouseButton::Left,
@@ -1279,7 +1279,7 @@ mod tests {
name: multi_click_separate_buttons,
initial_state: ClickState::DoubleClick,
initial_button: MouseButton::Left,
- input: GlutinEvent::WindowEvent {
+ input: WinitEvent::WindowEvent {
event: WindowEvent::MouseInput {
state: ElementState::Pressed,
button: MouseButton::Right,