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:
parent
6d4098ebd3
commit
0d4a26eff5
|
@ -322,9 +322,21 @@ - (void) windowRejectedFocusEvent:(const macdrv_event*)event
|
||||||
{
|
{
|
||||||
if (event->window_got_focus.serial == windowFocusSerial)
|
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 = (NSMutableSet*)event->window_got_focus.tried_windows;
|
||||||
[triedWindows addObject:(WineWindow*)event->window];
|
[triedWindows addObject:(WineWindow*)event->window];
|
||||||
for (NSWindow* window in [keyWindows arrayByAddingObjectsFromArray:[self orderedWineWindows]])
|
for (window in windows)
|
||||||
{
|
{
|
||||||
if (![triedWindows containsObject:window] && [window canBecomeKeyWindow])
|
if (![triedWindows containsObject:window] && [window canBecomeKeyWindow])
|
||||||
{
|
{
|
||||||
|
@ -333,6 +345,7 @@ - (void) windowRejectedFocusEvent:(const macdrv_event*)event
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
triedWindows = nil;
|
triedWindows = nil;
|
||||||
|
[windows release];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue