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

SDL_StartTextInput() does not trigger OSK on Wayland with Phosh #3578

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 2 comments · Fixed by #4360
Closed

SDL_StartTextInput() does not trigger OSK on Wayland with Phosh #3578

SDLBugzilla opened this issue Feb 11, 2021 · 2 comments · Fixed by #4360

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

Reported in version: 2.0.10
Reported for operating system, platform: Linux, ARM

Comments on the original bug report:

On 2020-03-09 19:27:58 +0000, wrote:

As far as I can tell from the documentation, calling SDL_StartTextInput() on mobile devices is supposed to trigger the onscreen keyboard. This does not appear to be the case with the Pinephone running Phosh.

My configuration on the Pinephone, where I encountered this problem is:

I tried both windowed and fullscreen mode and neither triggers the keyboard.

On 2020-03-10 14:23:46 +0000, Sam Lantinga wrote:

That's correct, nobody has implemented onscreen keyboard support for that setup. Are there other applications that can bring up the on-screen keyboard? If so, how do they do that?

On 2020-03-10 15:35:52 +0000, wrote:

I got in contact with the developers and received the following information:

"""
The protocol to control popup:

https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/master/unstable/text-input/text-input-unstable-v3.xml

the flow is rather simple: the application needs to request a zwp_text_input_v3 object from the manager via https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/master/unstable/text-input/text-input-unstable-v3.xml#L433

then it must listen for enter https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/master/unstable/text-input/text-input-unstable-v3.xml#L306
and finally commit an enable request https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/master/unstable/text-input/text-input-unstable-v3.xml#L87

after editing is over, send a disable request
"""

Let me know if you need more information

On 2020-03-10 15:40:41 +0000, wrote:

After commenting before I also got an example on how this is implemented in GTK:

https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/modules/input/imwayland.c

On 2020-03-10 15:58:58 +0000, wrote:

Also potentially helpful information I just received from the dev that implemented the protocol in the first place (Dorota):

"""
luckily, I'm in the process of redesigning the protocol (it's broken :(), so if I wrap my head around why I actually made it, I may be able to distill some insight for SDL. If someone interested from SDL filed an issue upstream, I'll give it proper thought: https://gitlab.freedesktop.org/wayland/wayland-protocols/issues
"""

On 2020-05-19 16:39:05 +0000, Ellie wrote:

Isn't this protocol needed for ANY Wayland platform to bring up the on-screen keyboard, like any device with touch where the on-screen keyboard should be used?

E.g. I have a linux laptop with touch, when I tap the screen over e.g. a gnome-terminal the gnome 3 onscreen keyboard comes up. I would assume for any SDL2 app it doesn't. Supporting this protocol would likely fix that. So this really doesn't seem to be Phosh-specific, or even mobile device-specific to me, and likely can be tested on any touch-capable device I would assume.

This appears to be the current protocol in question:

https://fossies.org/linux/misc/gtk+-3.24.20.tar.xz:a/gtk+-3.24.20/modules/input/text-input-unstable-v3-client-protocol.h

On 2020-05-29 00:11:02 +0000, Sebastian Krzyszkowiak wrote:

Isn't this protocol needed for ANY Wayland platform to bring up the on-screen keyboard, like any device with touch where the on-screen keyboard should be used?

Of course. This is by no means phosh specific.

This appears to be the current protocol in question:

A more useful link is https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/master/unstable/text-input/text-input-unstable-v3.xml which is already in comment # 2.

@flibitijibibo
Copy link
Collaborator

Meant to bump this - I don't think this is fixed by the current IME support, but unfortunately the official Wayland protocol does not actually work as far as I can tell.

The WIP implementation can be found here:

https://github.com/flibitijibibo/SDL/tree/zwp-textinput

It was easy to plug in, but it really truly is broken on both GNOME and Plasma. Even the official wlroots example does not work! So until someone wants to explain why literally no functioning example code exists for this, we'll just have to live with using ibus/fcitx directly.

@flibitijibibo
Copy link
Collaborator

Update on the zwp-textinput branch: The current protocol for text input is 100% unusable without another revision that supports physical keyboard input:

#4360 (comment)

I also noticed that the input rectangle didn't seem to bring up the selector for Kanji input, but the OSK is so messed up on my system that I have no way of knowing if our implementation is right. Either way we can't use it, so this is completely blocked for the foreseeable future.

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 a pull request may close this issue.

2 participants