Browse Source
[X11] IME hack for fcitx4 (#13435)
Co-authored-by: Max Katz <maxkatz6@outlook.com>
pull/13445/head
Nikita Tsukanov
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
19 additions and
2 deletions
-
src/Avalonia.X11/X11Window.Ime.cs
|
|
|
@ -317,8 +317,25 @@ namespace Avalonia.X11 |
|
|
|
while (_imeQueue.Count != 0) |
|
|
|
{ |
|
|
|
var ev = _imeQueue.Dequeue(); |
|
|
|
if (_imeControl == null || !await _imeControl.HandleEventAsync(ev.args, ev.keyval, ev.keycode)) |
|
|
|
ScheduleInput(ev.args); |
|
|
|
if (_imeControl != null) |
|
|
|
{ |
|
|
|
var handledByIme = await _imeControl.HandleEventAsync(ev.args, ev.keyval, ev.keycode); |
|
|
|
if (handledByIme && ev.args is not |
|
|
|
{ |
|
|
|
// We let filtered modifier-key KeyUp events through
|
|
|
|
// since some apps rely on the order of events to track individual (left/right)
|
|
|
|
// modifier keys states rather than relying on general key modifiers
|
|
|
|
Type: RawKeyEventType.KeyUp, |
|
|
|
Key: Key.LeftCtrl or Key.RightCtrl or Key.LeftAlt |
|
|
|
or Key.RightAlt or Key.LeftShift or Key.RightShift |
|
|
|
or Key.LWin or Key.RWin |
|
|
|
}) |
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
ScheduleInput(ev.args); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
finally |
|
|
|
|