Browse Source

Merge branch 'master' into update-net-5.0

pull/6757/head
Dan Walmsley 5 years ago
committed by GitHub
parent
commit
ed5a1a7d21
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      native/Avalonia.Native/src/OSX/window.mm

7
native/Avalonia.Native/src/OSX/window.mm

@ -2389,7 +2389,10 @@ NSArray* AllLoopModes = [NSArray arrayWithObjects: NSDefaultRunLoopMode, NSEvent
- (void)sendEvent:(NSEvent *)event - (void)sendEvent:(NSEvent *)event
{ {
if(_parent != nullptr) [super sendEvent:event];
/// This is to detect non-client clicks. This can only be done on Windows... not popups, hence the dynamic_cast.
if(_parent != nullptr && dynamic_cast<WindowImpl*>(_parent.getRaw()) != nullptr)
{ {
switch(event.type) switch(event.type)
{ {
@ -2419,8 +2422,6 @@ NSArray* AllLoopModes = [NSArray arrayWithObjects: NSDefaultRunLoopMode, NSEvent
break; break;
} }
} }
[super sendEvent:event];
} }
@end @end

Loading…
Cancel
Save