Browse Source
Merge pull request #4918 from AvaloniaUI/fixes/osx-prevent-events-before-window-shown
OSX: dont raise events when window isnt shown.
pull/4921/head
danwalmsley
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
9 additions and
0 deletions
-
src/Avalonia.Native/WindowImplBase.cs
|
|
|
@ -251,6 +251,9 @@ namespace Avalonia.Native |
|
|
|
|
|
|
|
public bool RawTextInputEvent(uint timeStamp, string text) |
|
|
|
{ |
|
|
|
if (_inputRoot is null) |
|
|
|
return false; |
|
|
|
|
|
|
|
Dispatcher.UIThread.RunJobs(DispatcherPriority.Input + 1); |
|
|
|
|
|
|
|
var args = new RawTextInputEventArgs(_keyboard, timeStamp, _inputRoot, text); |
|
|
|
@ -262,6 +265,9 @@ namespace Avalonia.Native |
|
|
|
|
|
|
|
public bool RawKeyEvent(AvnRawKeyEventType type, uint timeStamp, AvnInputModifiers modifiers, uint key) |
|
|
|
{ |
|
|
|
if (_inputRoot is null) |
|
|
|
return false; |
|
|
|
|
|
|
|
Dispatcher.UIThread.RunJobs(DispatcherPriority.Input + 1); |
|
|
|
|
|
|
|
var args = new RawKeyEventArgs(_keyboard, timeStamp, _inputRoot, (RawKeyEventType)type, (Key)key, (RawInputModifiers)modifiers); |
|
|
|
@ -278,6 +284,9 @@ namespace Avalonia.Native |
|
|
|
|
|
|
|
public void RawMouseEvent(AvnRawMouseEventType type, uint timeStamp, AvnInputModifiers modifiers, AvnPoint point, AvnVector delta) |
|
|
|
{ |
|
|
|
if (_inputRoot is null) |
|
|
|
return; |
|
|
|
|
|
|
|
Dispatcher.UIThread.RunJobs(DispatcherPriority.Input + 1); |
|
|
|
|
|
|
|
switch (type) |
|
|
|
|