mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 07:46:12 +03:00
Merge pull request #1131 from mitchellh/chinese-quotes
apprt/gtk: only reset IME state if key consuming while IME composing
This commit is contained in:
@ -1482,10 +1482,15 @@ fn keyEvent(
|
||||
.closed => return true,
|
||||
.ignored => {},
|
||||
.consumed => if (action == .press or action == .repeat) {
|
||||
// If we consume the key then we want to reset the dead key
|
||||
// state.
|
||||
c.gtk_im_context_reset(self.im_context);
|
||||
self.core_surface.preeditCallback(null) catch {};
|
||||
// If we were in the composing state then we reset our context.
|
||||
// We do NOT want to reset if we're not in the composing state
|
||||
// because there is other IME state that we want to preserve,
|
||||
// such as quotation mark ordering for Chinese input.
|
||||
if (self.im_composing) {
|
||||
c.gtk_im_context_reset(self.im_context);
|
||||
self.core_surface.preeditCallback(null) catch {};
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user