javafxports / openjdk-jfx

The openjfx repo has moved to:
https://github.com/openjdk/jfx
GNU General Public License v2.0
1.01k stars 145 forks source link

IME position is wrong (windows) #361

Open littlecatheart opened 5 years ago

littlecatheart commented 5 years ago

It's frastracted that the IME position is shifted to the bottom of the screen for CJK users.

image

littlecatheart commented 5 years ago

The ideal way should be: image

littlecatheart commented 5 years ago

Seems swing based apps have no such issue (IntelliJ): image

littlecatheart commented 5 years ago

I think IME support with correct prompt positon should be a core and fundamental feature for all international GUI libraries. It will directly impact users' experience, because the bug is moe obvious than other potential bugs.

brcolow commented 5 years ago

I believe this functionality can be added to modules/javafx.graphics/src/main/native-glass/win/GlassWindow.cpp by following the documentation here:

https://docs.microsoft.com/en-us/windows/desktop/intl/input-method-manager

Specifically the docs mention:

"Your application can direct an IME window to carry out a command, for example, change the position of a composition window, by using the WM_IME_CONTROL message."

littlecatheart commented 5 years ago

Thanks brcolow. You mean I should manually send WM_IME_CONTROL message or just add a case to handle this message? image

brcolow commented 5 years ago

Reading the docs:

Well the WM_IME fields in that switch statement are sent to the application whereas WM_IME_CONTROL is sent by* the application. It seems "WM_IME_SETCONTEXT" is "Sent to an application when a window is activated. A window receives this message through its WindowProc function." so it would probably make sense to add that case to the switch statement you showed and then send a WM_IME_CONTROL to change the location of the window.