From 7a8a002da6a7c5b17edf5dc8cc8e3f9e089632fc Mon Sep 17 00:00:00 2001 From: nolanl <720974+nolanl@users.noreply.github.com> Date: Mon, 17 Sep 2018 13:00:42 -0700 Subject: [PATCH] Acknowledge first click on unfocused windows with bsd/linux Fixes a regression on non-macOS platforms caused by the fix for issue #1291. The fix is to follow platform norms for mouse click behavior on unfocused terminals. On macOS, the first click (that gives the window focus) is swallowed, and has no effect on the terminal. On all other platforms, the first click is passed through to the terminal. --- CHANGELOG.md | 4 ++++ src/event.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 031a3b90..feb115e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- First click on unfocused Alacritty windows is no longer ignored on platforms other than macOS + ## Version 0.2.0 ### Added diff --git a/src/event.rs b/src/event.rs index 589f1a42..ec17034f 100644 --- a/src/event.rs +++ b/src/event.rs @@ -341,7 +341,7 @@ impl Processor { processor.received_char(c); }, MouseInput { state, button, modifiers, .. } => { - if *window_is_focused { + if !cfg!(target_os = "macos") || *window_is_focused { *hide_cursor = false; processor.mouse_input(state, button, modifiers); processor.ctx.terminal.dirty = true;