Browse Source
Don't apply our weird window positioning hacks for clicks on traffic lights (#17181)
This hack fixes the minimize problem with macOS 15.0
pull/17190/head
Nikita Tsukanov
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
19 additions and
1 deletions
-
native/Avalonia.Native/src/OSX/AvnWindow.mm
|
|
|
@ -452,6 +452,16 @@ |
|
|
|
return pt; |
|
|
|
} |
|
|
|
|
|
|
|
- (NSView*) findRootView:(NSView*)view |
|
|
|
{ |
|
|
|
while (true) { |
|
|
|
auto parent = [view superview]; |
|
|
|
if(parent == nil) |
|
|
|
return view; |
|
|
|
view = parent; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
- (void)sendEvent:(NSEvent *_Nonnull)event |
|
|
|
{ |
|
|
|
[super sendEvent:event]; |
|
|
|
@ -467,7 +477,15 @@ |
|
|
|
AvnView* view = parent->View; |
|
|
|
NSPoint windowPoint = [event locationInWindow]; |
|
|
|
NSPoint viewPoint = [view convertPoint:windowPoint fromView:nil]; |
|
|
|
|
|
|
|
|
|
|
|
auto targetView = [[self findRootView:view] hitTest: windowPoint]; |
|
|
|
if(targetView) |
|
|
|
{ |
|
|
|
auto targetViewClass = [targetView className]; |
|
|
|
if([targetViewClass containsString: @"_NSThemeWidget"]) |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (!NSPointInRect(viewPoint, view.bounds)) |
|
|
|
{ |
|
|
|
auto avnPoint = ToAvnPoint(windowPoint); |
|
|
|
|