浏览代码

ensure higher priority tasks are run before keyboard events.

Dan Walmsley 7 年之前
父节点
当前提交
2b081c516f
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/Avalonia.Native/WindowImplBase.cs

+ 4 - 0
src/Avalonia.Native/WindowImplBase.cs

@@ -184,6 +184,8 @@ namespace Avalonia.Native
 
         public bool RawTextInputEvent(uint timeStamp, string text)
         {
+            Dispatcher.UIThread.RunJobs(DispatcherPriority.Input + 1);
+
             var args = new RawTextInputEventArgs(_keyboard, timeStamp, text);
 
             Input?.Invoke(args);
@@ -193,6 +195,8 @@ namespace Avalonia.Native
 
         public bool RawKeyEvent(AvnRawKeyEventType type, uint timeStamp, AvnInputModifiers modifiers, uint key)
         {
+            Dispatcher.UIThread.RunJobs(DispatcherPriority.Input + 1);
+
             var args = new RawKeyEventArgs(_keyboard, timeStamp, (RawKeyEventType)type, (Key)key, (InputModifiers)modifiers);
 
             Input?.Invoke(args);