Browse Source

Remove activateAppropriateChild logic.

It was causing both parent and child windows to think they were the key window at the same time and it's not really needed anymore since the implementation of real child windows as far as I can see.
pull/6188/head
Steven Kirk 5 years ago
parent
commit
091ffe5fa8
  1. 34
      native/Avalonia.Native/src/OSX/window.mm

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

@ -2055,22 +2055,6 @@ NSArray* AllLoopModes = [NSArray arrayWithObjects: NSDefaultRunLoopMode, NSEvent
return _canBecomeKeyAndMain; return _canBecomeKeyAndMain;
} }
-(bool) activateAppropriateChild: (bool)activating
{
for(NSWindow* uch in [self childWindows])
{
auto ch = objc_cast<AvnWindow>(uch);
if(ch == nil)
continue;
[ch activateAppropriateChild:false];
return FALSE;
}
if(!activating)
[self makeKeyAndOrderFront:self];
return TRUE;
}
-(bool)shouldTryToHandleEvents -(bool)shouldTryToHandleEvents
{ {
return _isEnabled; return _isEnabled;
@ -2081,26 +2065,15 @@ NSArray* AllLoopModes = [NSArray arrayWithObjects: NSDefaultRunLoopMode, NSEvent
_isEnabled = enable; _isEnabled = enable;
} }
-(void)makeKeyWindow
{
if([self activateAppropriateChild: true])
{
[super makeKeyWindow];
}
}
-(void)becomeKeyWindow -(void)becomeKeyWindow
{ {
[self showWindowMenuWithAppMenu]; [self showWindowMenuWithAppMenu];
if([self activateAppropriateChild: true]) if(_parent != nullptr)
{ {
if(_parent != nullptr) _parent->BaseEvents->Activated();
{
_parent->BaseEvents->Activated();
}
} }
[super becomeKeyWindow]; [super becomeKeyWindow];
} }
@ -2110,7 +2083,6 @@ NSArray* AllLoopModes = [NSArray arrayWithObjects: NSDefaultRunLoopMode, NSEvent
if(parent != nil) if(parent != nil)
{ {
[parent removeChildWindow:self]; [parent removeChildWindow:self];
[parent activateAppropriateChild: false];
} }
} }

Loading…
Cancel
Save