Skip to content

Commit

Permalink
Don't apply our weird window positioning hacks for clicks on traffic …
Browse files Browse the repository at this point in the history
…lights (#17181)

This hack fixes the minimize problem with macOS 15.0
  • Loading branch information
kekekeks authored and grokys committed Oct 8, 2024
1 parent c407354 commit 06f7715
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion native/Avalonia.Native/src/OSX/AvnWindow.mm
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,16 @@ - (AvnPoint) translateLocalPoint:(AvnPoint)pt
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];
Expand All @@ -453,7 +463,15 @@ - (void)sendEvent:(NSEvent *_Nonnull)event
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 = [AvnView toAvnPoint:windowPoint];
Expand Down

0 comments on commit 06f7715

Please sign in to comment.