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 Oct 3, 2024
1 parent b49b255 commit b17153f
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 @@ -452,6 +452,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 @@ -467,7 +477,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 = ToAvnPoint(windowPoint);
Expand Down

0 comments on commit b17153f

Please sign in to comment.