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 crash by clicking on candidates when librime-predict enabled #1070

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

fxliang
Copy link
Contributor

@fxliang fxliang commented Jan 2, 2024

No description provided.

inputs[0].ki = {VK_PRIOR, 0,0,0,0};
inputs[1].type = INPUT_KEYBOARD;
inputs[1].ki = {VK_PRIOR, 0,KEYEVENTF_KEYUP,0,0};
::SendInput(sizeof(inputs) / sizeof(INPUT), inputs, sizeof(INPUT));
Copy link
Member

Choose a reason for hiding this comment

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

I guess we can try to defer the _UpdateComposition call, or send an input key right here.

Sending an input key to the system essentially postpones the key event handling.

Copy link
Contributor Author

@fxliang fxliang Jan 3, 2024

Choose a reason for hiding this comment

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

if we only do _UpdateComposition here, the crash is fixed, however the prediction will not shown until next key press comes.

Copy link
Member

Choose a reason for hiding this comment

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

How did the crash happen?

How is it fixed then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How did the crash happen?

How is it fixed then?

maybe some object is referenced after released, after prediction is enabled and clicking select on non-prediction candidate

maybe some status different from space-selecting or auto-committing.

@fxliang fxliang requested a review from lotem January 17, 2024 13:16
@lotem lotem merged commit 9061a1a into rime:master Jan 19, 2024
1 check passed
@fxliang fxliang deleted the predict-crash branch January 20, 2024 03:31
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 this pull request may close these issues.

2 participants