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

Fix IME doesn't work under Popup on Windows. #77977

Merged
merged 1 commit into from
Jun 9, 2023

Conversation

zaevi
Copy link
Contributor

@zaevi zaevi commented Jun 7, 2023

Fix #77837 and fix #73591

ime_fix

Set keyboard focus for is_popup window otherwise it won't produce WM_IME_STARTCOMPOSITION and IME won't work.

See https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setfocus:

If a window is active but does not have the focus, any key pressed produces the WM_SYSCHAR, WM_SYSKEYDOWN, or WM_SYSKEYUP message. If the VK_MENU key is also pressed, bit 30 of the lParam parameter of the message is set. Otherwise, the messages produced do not have this bit set.

@zaevi zaevi requested a review from a team as a code owner June 7, 2023 18:48
@akien-mga akien-mga added this to the 4.1 milestone Jun 8, 2023
@akien-mga akien-mga requested a review from bruvzg June 8, 2023 21:03
@akien-mga
Copy link
Member

#73591 mentions the same issue on macOS so I guess it wouldn't be fully fixed by this PR.

@zaevi
Copy link
Contributor Author

zaevi commented Jun 9, 2023

#73591 mentions the same issue on macOS so I guess it wouldn't be fully fixed by this PR.

I don't have macOS env to debug, but the cause might be similar.

Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same was done for Linux/X11 - #72497

I can reproduce it on macOS, but not on Windows, but in general a window that is expected to take keyboard input should have keyboard focus.

@akien-mga akien-mga merged commit 759309b into godotengine:master Jun 9, 2023
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants