mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
In FocusNextWindow, require that window is visible before trying to focus it
This commit is contained in:
@@ -5,19 +5,17 @@
|
||||
#import "atom_application.h"
|
||||
#import "atom_window_controller.h"
|
||||
|
||||
|
||||
void AtomCefClient::FocusNextWindow() {
|
||||
NSArray *windows = [NSApp windows];
|
||||
int count = [windows count];
|
||||
int start = [windows indexOfObject:[NSApp mainWindow]];
|
||||
int start = [windows indexOfObject:[NSApp keyWindow]];
|
||||
|
||||
int i = start;
|
||||
while (true) {
|
||||
i = (i + 1) % count;
|
||||
|
||||
if (i == start) break;
|
||||
|
||||
NSWindow *window = [windows objectAtIndex:i];
|
||||
if (![window isExcludedFromWindowsMenu]) {
|
||||
if ([window isVisible] && ![window isExcludedFromWindowsMenu]) {
|
||||
[window makeKeyAndOrderFront:nil];
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user