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

TextField IME candidate list pane invisible on Windows #1766

Open
tabris17 opened this issue Feb 28, 2024 · 8 comments
Open

TextField IME candidate list pane invisible on Windows #1766

tabris17 opened this issue Feb 28, 2024 · 8 comments

Comments

@tabris17
Copy link

target is windows native

The cause of this issue is that the SDL version is too old.

openfl/libsdl/blob/master/src/video/windows/SDL_windowskeyboard.c

videodata->ime_uiless = UILess_SetupSinks(videodata);

This line of code causes the IME candidate pane to not be rendered.
and this issue has been fixed in the latest version of SDL:

libsdl-org/SDL/blob/main/src/video/windows/SDL_windowskeyboard.c

if (WIN_ShouldShowNativeUI()) {
    videodata->ime_uiless = SDL_FALSE;
} else {
    videodata->ime_uiless = UILess_SetupSinks(videodata);
}
@tabris17 tabris17 changed the title TextField IME candidate pane invisible on Windows TextField IME candidate list pane invisible on Windows Feb 28, 2024
@player-03
Copy link
Contributor

See #1684 for the work that's been done on this, though it does seem to have stalled.

@tabris17
Copy link
Author

Is it possible to fix openfl/libsdl with temporary patch?

The code below works fine on my windows system:

#if defined(__WIN32__)
videodata->ime_uiless = SDL_FALSE;
#else
videodata->ime_uiless = UILess_SetupSinks(videodata);
#endif

@player-03
Copy link
Contributor

Sure, submit a PR.

@joshtynjala
Copy link
Member

It is probably worth mentioning that the 8.2.0-Dev branch switched from openfl/libsdl to libsdl-org/SDL. Any further changes that we make to openfl/libsdl will be lost with the Lime 8.2 update.

@joshtynjala
Copy link
Member

However, I see that support for the Windows IME window was added in commit libsdl-org/SDL@6f97205. I see that's part of SDL's release-2.0.18 tag. The 8.2.0-Dev branch appears to be on release-2.30.0, so this fix will be included in Lime 8.2 already.

@player-03
Copy link
Contributor

Oh whoops, I got the dates wrong. I thought 8.2.0-Dev didn't have the fix, so I didn't mention it.

@tabris17
Copy link
Author

I have tried 8.2.0-Dev branch and found that SDL_HINT_IME_SHOW_UI is not enable by default.

The following code needs to be added to the SDLWindow::SDLWindow() function to display the IME candidate list:

#if defined (HX_WINDOWS)
SDL_SetHint (SDL_HINT_IME_SHOW_UI, "1");
#endif

@player-03
Copy link
Contributor

That feels like something most users won't need.

But SDL_SetHint() is declared extern; I wonder if that means you can get at it using CFFI? Then you'd be able to set whatever hints you needed. Sadly I don't know enough about CFFI to say for sure.

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

No branches or pull requests

3 participants