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

Input focus when switching windows #3371

Open
aadcg opened this issue Mar 27, 2024 · 1 comment
Open

Input focus when switching windows #3371

aadcg opened this issue Mar 27, 2024 · 1 comment

Comments

@aadcg
Copy link
Member

aadcg commented Mar 27, 2024

Commit 3c71755 introduced the need to grab the focus of the main buffer (e.g. by clicking it) so that it accepts key events.

To reproduce it, notice that you need to click the main buffer to issue C-space.

@aadcg aadcg mentioned this issue Mar 27, 2024
5 tasks
@aadcg aadcg self-assigned this Jun 21, 2024
@aadcg
Copy link
Member Author

aadcg commented Jun 25, 2024

It is not related to 3c71755 and it is, most likely, an Electron bug on Linux.

If it were due to 3c71755, then the same would happen on the WebKitGTK port.

The following happens on the Electron port:

  • the prompt buffer has the focus;
  • the user switches window;
  • the user switches back to Nyxt;
  • the window gets the focus (instead of the prompt buffer, as expected).

Another way to reproduce it is to invoke execute-command and evaluate the expression below (which return false):

(progn
  (electron:focus (current-prompt-buffer))
  (sleep 1)
  (electron:is-focused (current-prompt-buffer)))

Note that on macOS, the bug isn't observed!

Marking it as low since it may be fixed in newer Electron version. The main conclusion here is that this odd behaviour isn't due to our Electron port logic.

@aadcg aadcg added the low label Jun 25, 2024
@aadcg aadcg removed their assignment Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant