Skip to content

Edit: take native focus while editing text - #2

Open
zx2c4 wants to merge 1 commit into
lsp-plugins:masterfrom
zx2c4-forks:text-input-focus
Open

zx2c4 wants to merge 1 commit into
lsp-plugins:masterfrom
zx2c4-forks:text-input-focus

Conversation

@zx2c4

@zx2c4 zx2c4 commented Nov 17, 2026

Copy link
Copy Markdown

Text fields only focused visually by the toolkit, but not by X11 underneath semantically, so the host can still consume Space and other shortcuts instead of letting them reach the field. Practically speaking, this means that if you type a space in the text field of A/B, it triggers start/stop in REAPER. Fix this by letting widgets say whether they need native focus, and update it when the focused widget changes.

This depends on lsp-plugins/lsp-ws-lib#8

Text fields only focused visually by the toolkit, but not by X11
underneath semantically, so the host can still consume Space and other
shortcuts instead of letting them reach the field. Practically speaking,
this means that if you type a space in the text field of A/B, it
triggers start/stop in REAPER. Fix this by letting widgets say whether
they need native focus, and update it when the focused widget changes.

This depends on lsp-plugins/lsp-ws-lib#8
@sadko4u sadko4u self-assigned this Nov 17, 2026
@sadko4u

sadko4u commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Hello!
Thank you for the contribution!
Just pushed changes to the devel branch: 3ed0d6c
I did some changes to avoid needs_input_focus. Instead of this, I added take_input_focus method and made the Edit widget to call it when necessary, so please verify that it works correctly for REAPER.

@zx2c4

zx2c4 commented Nov 18, 2026

Copy link
Copy Markdown
Author

You broke it in your devel branch. It needs to relinquish focus when selecting a non-textedit control. In my code, it does this. In your new commit, it does not. Focus is only then relinquished when selecting REAPER again, but not when selecting a non-textedit control within the plugin.

@sadko4u

sadko4u commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

@zx2c4 It appears that this commit fixes it: 9d7d593

But now we have troubles with REAPER:

  • load multi-sampler plugin and start entering instrument name.
  • click on the text field above the plugin's embedded window.
  • REAPER will show the blinking cusor in this text field but when you type something, the LSP window will catch this input.

The reason is that LSP window does not receive any FocusOut event in this scenario.

@zx2c4

zx2c4 commented Nov 18, 2026

Copy link
Copy Markdown
Author

If you revert all your commits and use my original, does that still happen?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants