linebender / glazier

Deprecated Rust Window Creation Library
Apache License 2.0
206 stars 32 forks source link

GNOME (Wayland): On-Screen keyboard doesn't display in edit_text #135

Closed DJMcNab closed 1 year ago

DJMcNab commented 1 year ago

This does work in Firefox, but not in our Wayland backend. It's not clear if we need to implement an additional API for this. Naïvely, I'd expect this to be based on the text input protocol, but I believe we implement this correctly.

Based on https://github.com/alacritty/alacritty/issues/6644, it appears that this should work. However, a test of the latest Alacritty release at the time of writing:

fsh ❯ alacritty --version
alacritty 0.12.2

doesn't support the on-screen keyboard on my machine.

Testing also using Konsole and Kwrite (KDE's QT based terminal emulator and text editor) also shows the on-screen keyboard not working. This suggests that the on-screen keyboard uses some GTK specific API, so unless we can find where this is documented, I don't believe we can fix this. See also https://github.com/microsoft/vscode/issues/81962.

The Alacritty issue does bring up an additional feature we need to implement - namely zwp_text_input_v3::set_content_type. Winit uses a simple API for this - we should instead have this be part of the input lock, but we need to make similar choices about a set of options.

DJMcNab commented 1 year ago

The only relevant docs I've found are https://unix.stackexchange.com/questions/647515/control-visibility-of-gnome-3-on-screen-keyboard. These suggest it's intended that the on-screen keyboard only works for GTK apps.

If anyone wants this functionality in future, the only viable path forward that I can see is to fix Gnome to use the Wayland Text Input API for its on-screen keyboard. Otherwise, you may be able to migrate to a desktop environment or third-party on-screen keyboard which supports making non-GTK toolkits accessible.