aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/input/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'alacritty/src/input/mod.rs')
-rw-r--r--alacritty/src/input/mod.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/alacritty/src/input/mod.rs b/alacritty/src/input/mod.rs
index 365717c3..4900e26f 100644
--- a/alacritty/src/input/mod.rs
+++ b/alacritty/src/input/mod.rs
@@ -20,10 +20,10 @@ use winit::event::{
ElementState, Modifiers, MouseButton, MouseScrollDelta, Touch as TouchEvent, TouchPhase,
};
#[cfg(target_os = "macos")]
-use winit::event_loop::EventLoopWindowTarget;
+use winit::event_loop::ActiveEventLoop;
use winit::keyboard::ModifiersState;
#[cfg(target_os = "macos")]
-use winit::platform::macos::EventLoopWindowTargetExtMacOS;
+use winit::platform::macos::ActiveEventLoopExtMacOS;
use winit::window::CursorIcon;
use alacritty_terminal::event::EventListener;
@@ -107,7 +107,7 @@ pub trait ActionContext<T: EventListener> {
fn message(&self) -> Option<&Message>;
fn config(&self) -> &UiConfig;
#[cfg(target_os = "macos")]
- fn event_loop(&self) -> &EventLoopWindowTarget<Event>;
+ fn event_loop(&self) -> &ActiveEventLoop;
fn mouse_mode(&self) -> bool;
fn clipboard_mut(&mut self) -> &mut Clipboard;
fn scheduler_mut(&mut self) -> &mut Scheduler;
@@ -1004,17 +1004,18 @@ impl<T: EventListener, A: ActionContext<T>> Processor<T, A> {
let mouse_bindings = self.ctx.config().mouse_bindings().to_owned();
// If mouse mode is active, also look for bindings without shift.
- let mut check_fallback = mouse_mode && mods.contains(ModifiersState::SHIFT);
+ let fallback_allowed = mouse_mode && mods.contains(ModifiersState::SHIFT);
+ let mut exact_match_found = false;
for binding in &mouse_bindings {
// Don't trigger normal bindings in mouse mode unless Shift is pressed.
- if binding.is_triggered_by(mode, mods, &button) && (check_fallback || !mouse_mode) {
+ if binding.is_triggered_by(mode, mods, &button) && (fallback_allowed || !mouse_mode) {
binding.action.execute(&mut self.ctx);
- check_fallback = false;
+ exact_match_found = true;
}
}
- if check_fallback {
+ if fallback_allowed && !exact_match_found {
let fallback_mods = mods & !ModifiersState::SHIFT;
for binding in &mouse_bindings {
if binding.is_triggered_by(mode, fallback_mods, &button) {
@@ -1224,7 +1225,7 @@ mod tests {
}
#[cfg(target_os = "macos")]
- fn event_loop(&self) -> &EventLoopWindowTarget<Event> {
+ fn event_loop(&self) -> &ActiveEventLoop {
unimplemented!();
}