winemac: Use window server's window list to find next window to offer focus to.

... rather than our orderedWineWindows array, which is going away.
This commit is contained in:
Ken Thomases 2013-05-16 18:43:28 -05:00 committed by Alexandre Julliard
parent 6d4098ebd3
commit 0d4a26eff5

View file

@ -322,9 +322,21 @@ - (void) windowRejectedFocusEvent:(const macdrv_event*)event
{
if (event->window_got_focus.serial == windowFocusSerial)
{
NSMutableArray* windows = [keyWindows mutableCopy];
NSNumber* windowNumber;
WineWindow* window;
for (windowNumber in [NSWindow windowNumbersWithOptions:NSWindowNumberListAllSpaces])
{
window = (WineWindow*)[NSApp windowWithWindowNumber:[windowNumber integerValue]];
if ([window isKindOfClass:[WineWindow class]] && [window screen] &&
![windows containsObject:window])
[windows addObject:window];
}
triedWindows = (NSMutableSet*)event->window_got_focus.tried_windows;
[triedWindows addObject:(WineWindow*)event->window];
for (NSWindow* window in [keyWindows arrayByAddingObjectsFromArray:[self orderedWineWindows]])
for (window in windows)
{
if (![triedWindows containsObject:window] && [window canBecomeKeyWindow])
{
@ -333,6 +345,7 @@ - (void) windowRejectedFocusEvent:(const macdrv_event*)event
}
}
triedWindows = nil;
[windows release];
}
}