aboutsummaryrefslogtreecommitdiff
path: root/src/event.rs
diff options
context:
space:
mode:
authorChristian Duerr <chrisduerr@users.noreply.github.com>2019-01-08 07:37:58 +0000
committerGitHub <noreply@github.com>2019-01-08 07:37:58 +0000
commitc54115516717d6fd429065158d81a93c0818fefa (patch)
tree1054379f18edaacc42d127b9beb7f8d6e2fda98d /src/event.rs
parent2b0d19e18f2c92bc4ec9e53e7f1619c8604be937 (diff)
downloadalacritty-c54115516717d6fd429065158d81a93c0818fefa.tar.gz
alacritty-c54115516717d6fd429065158d81a93c0818fefa.zip
Fix selection with right and middle mouse
Since there was no check for the button state for semantic and line selection, it was possible to trigger selection using the middle and right mouse button. This has been resolved by explicitly checking for the pressed button before starting these selections. To further ensure that double and triple clicks are only triggered when the same button is pressed multiple times, the last pressed button is stored. This fixes #1915.
Diffstat (limited to 'src/event.rs')
-rw-r--r--src/event.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/event.rs b/src/event.rs
index 4f7f1a76..bada4f68 100644
--- a/src/event.rs
+++ b/src/event.rs
@@ -10,7 +10,7 @@ use std::env;
use serde_json as json;
use parking_lot::MutexGuard;
-use glutin::{self, ModifiersState, Event, ElementState};
+use glutin::{self, ModifiersState, Event, ElementState, MouseButton};
use copypasta::{Clipboard, Load, Store, Buffer as ClipboardBuffer};
use glutin::dpi::PhysicalSize;
@@ -245,6 +245,7 @@ pub struct Mouse {
pub cell_side: Side,
pub lines_scrolled: f32,
pub block_url_launcher: bool,
+ pub last_button: MouseButton,
}
impl Default for Mouse {
@@ -263,6 +264,7 @@ impl Default for Mouse {
cell_side: Side::Left,
lines_scrolled: 0.0,
block_url_launcher: false,
+ last_button: MouseButton::Other(0),
}
}
}