Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly filter focus events from the console API #15606

Merged
merged 2 commits into from
Jun 27, 2023

Conversation

lhecker
Copy link
Member

@lhecker lhecker commented Jun 26, 2023

This is an improved fix for #13238. Instead of handling focus events in
the TerminalInput::HandleKey function and the need to filter them
out depending on where they came from, we simply don't call HandleKey
in the first place. This makes the somewhat unreliable CameFromApi
function unnecessary and the code a bit more robust.

This change is required because CameFromApi is not representable
in a INPUT_RECORD and I'm getting rid of IInputEvent.

Validation Steps Performed

  • No [O when exiting nvim ✅
  • Mouse input in nvim works ✅

@lhecker lhecker added Area-Input Related to input processing (key presses, mouse, etc.) Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. labels Jun 26, 2023
@@ -195,8 +195,7 @@ void HandleFocusEvent(const BOOL fSetFocus)

try
{
const auto EventsWritten = gci.pInputBuffer->Write(std::make_unique<FocusEvent>(!!fSetFocus));
FAIL_FAST_IF(EventsWritten != 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lmao, FAIL_FAST_IF inside a try{}

Base automatically changed from dev/lhecker/8000-ApiRoutines-cleanup to main June 27, 2023 13:33
@lhecker lhecker force-pushed the dev/lhecker/8000-camefromapi branch from 54843ee to 479c12c Compare June 27, 2023 13:35
@lhecker lhecker merged commit 58e1380 into main Jun 27, 2023
@lhecker lhecker deleted the dev/lhecker/8000-camefromapi branch June 27, 2023 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. Area-Input Related to input processing (key presses, mouse, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants