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

Make popup grabs work when an IME has a keyboard grab #124

Open
kchibisov opened this issue Jan 23, 2024 · 3 comments
Open

Make popup grabs work when an IME has a keyboard grab #124

kchibisov opened this issue Jan 23, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@kchibisov
Copy link
Contributor

Keep in mind that IME can't work with QT at all, so I just basically don't have popups until I kill anthywl or something.

You can probably just start anthywl and QT apps, like telegram won't have rmb popup on message working at all. This was not the thing a while ago, so I guess some new logic in niri broke it.

niri 0.1.0-alpha.3 (v0.1.0-alpha.3-65-g65e8649)

@kchibisov kchibisov changed the title Popups in Qt applications not appear anymore if IME is running popups grab doesn't work when IME is running Jan 23, 2024
@YaLTeR YaLTeR added the bug Something isn't working label Jan 23, 2024
@kchibisov
Copy link
Contributor Author

This is not QT specific, and relates to grabs.

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 23, 2024

This will need some refactoring to fix properly, perhaps in Smithay. For now let's ignore popup grabs when an IME keyboard grab is active. f5642ab

@YaLTeR YaLTeR changed the title popups grab doesn't work when IME is running Make popup grabs work when an IME has a keyboard grab Jan 23, 2024
@YaLTeR YaLTeR added enhancement New feature or request and removed bug Something isn't working labels Jan 23, 2024
@YaLTeR
Copy link
Owner

YaLTeR commented Jan 23, 2024

For more context, the problem is that:

  • IME sets a keyboard grab to read key events.
  • Popup grabs set a keyboard grab to keep the keyboard focus on the popup surface (normally the keyboard focus remains on the toplevel).
    • There's also a check when obtaining the popup grab that the keyboard focus was correct. If it wasn't, the popup grab is denied.
  • Keyboard grabs in Smithay don't stack, so one of these replaces the other. Then the keyboard grab check fails and the popup grab is denied.

Now tbh I'm not sure we need the popup keyboard grab in niri, it will probably be better to refactor the keyboard focus code a bit and keep track of it ourselves. This might solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants