Skip to content

Fix passNextKey after entering fullscreen - #4944

Open
maignal wants to merge 3 commits into
philc:masterfrom
maignal:master
Open

maignal wants to merge 3 commits into
philc:masterfrom
maignal:master

Conversation

@maignal

@maignal maignal commented Sep 6, 2026 •

Copy link
Copy Markdown

Description

This PR fixes #4250 (and also fixes #3922 and fixes #4389) where entering fullscreen, with a key pressed right after the passNextKey command was triggered, would keep the passNextKey mode open and keep passing keys to the page.

This fix exit the common one-key case before passing the key to the page.
I wrote a unit test and I'm currently using this feature daily.

If this fix doesn't suit you, I'm happy to search for an alternative :)

@philg-dev

Copy link
Copy Markdown
Contributor

Looks pretty good to me!

I assume, that "prematurely" exiting the passNextKeyMode can't possibly have any weird side effects?

With the fix, the corresponding keyUp event would always go to Vimium's Normal Mode, but I think Normal Mode doesn't care about keyUp events, so it'll end up being passed to the page anyway - correct? Because if my assumption is incorrect, then the fix would break the passNextKeyMode for cases where the keyUp event is the relevant event that the user wants to pass to the underlying page.

At least I couldn't find any references to keyUp in mode_normal.js. I don't have time to dig deeper right now, but I'm pretty sure it's fine the way the fix implemented.

@maignal

maignal commented Sep 6, 2026

Copy link
Copy Markdown
Author

Correct. After PassNextKeyMode exits, the matching keyup goes through the handler stack again. NormalMode only installs a keydown handler, so it does not consume that keyup. It falls through to the page normally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants