mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-02-16 07:41:08 +00:00
Merge pull request #84 from Soph/develop
improved logic to choose right window to show dialogs in
This commit is contained in:
@@ -162,7 +162,11 @@
|
||||
}
|
||||
|
||||
- (UIWindow *)findVisibleWindow {
|
||||
UIWindow *visibleWindow = nil;
|
||||
UIWindow *visibleWindow = [UIApplication sharedApplication].keyWindow;
|
||||
|
||||
if (!(visibleWindow.hidden)) {
|
||||
return visibleWindow;
|
||||
}
|
||||
|
||||
// if the rootViewController property (available >= iOS 4.0) of the main window is set, we present the modal view controller on top of the rootViewController
|
||||
NSArray *windows = [[UIApplication sharedApplication] windows];
|
||||
@@ -171,7 +175,7 @@
|
||||
visibleWindow = window;
|
||||
}
|
||||
if ([UIWindow instancesRespondToSelector:@selector(rootViewController)]) {
|
||||
if ([window rootViewController]) {
|
||||
if (!(window.hidden) && ([window rootViewController])) {
|
||||
visibleWindow = window;
|
||||
BITHockeyLog(@"INFO: UIWindow with rootViewController found: %@", visibleWindow);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user