diff --git a/AppFramework/Keyboard/GREYKeyboard.h b/AppFramework/Keyboard/GREYKeyboard.h index 4669c07e8..789917542 100644 --- a/AppFramework/Keyboard/GREYKeyboard.h +++ b/AppFramework/Keyboard/GREYKeyboard.h @@ -39,11 +39,6 @@ NS_ASSUME_NONNULL_BEGIN inFirstResponder:(id)firstResponder error:(__strong NSError **)errorOrNil; -/** - * @return @c YES if the keyboard is visible, @c NO otherwise. - */ -+ (BOOL)isKeyboardVisible; - /** * Waits until the keyboard is visible on the screen. * diff --git a/AppFramework/Keyboard/GREYKeyboard.m b/AppFramework/Keyboard/GREYKeyboard.m index 8aba54c69..373c584d2 100644 --- a/AppFramework/Keyboard/GREYKeyboard.m +++ b/AppFramework/Keyboard/GREYKeyboard.m @@ -283,10 +283,6 @@ + (BOOL)typeString:(NSString *)string return YES; } -+ (BOOL)isKeyboardVisible { - return atomic_load(&gIsKeyboardShown); -} - + (BOOL)waitForKeyboardToAppear { if (atomic_load(&gIsKeyboardShown)) { return YES; diff --git a/UILib/GREYScreenshotter.m b/UILib/GREYScreenshotter.m index 1a31e7671..1900b0519 100644 --- a/UILib/GREYScreenshotter.m +++ b/UILib/GREYScreenshotter.m @@ -128,7 +128,7 @@ + (UIImage *)grey_takeScreenshotAfterScreenUpdates:(BOOL)afterScreenUpdates inScreenRect:(CGRect)screenRect withStatusBar:(BOOL)includeStatusBar forDebugging:(BOOL)forDebugging { - UIGraphicsBeginImageContextWithOptions(screenRect.size, YES, 0); + UIGraphicsBeginImageContextWithOptions(screenRect.size, NO, 0); [self drawScreenInContext:UIGraphicsGetCurrentContext() afterScreenUpdates:afterScreenUpdates inScreenRect:screenRect @@ -151,11 +151,8 @@ + (void)drawScreenInContext:(CGContextRef)bitmapContextRef // The bitmap context width and height are scaled, so we need to undo the scale adjustment. NSEnumerator *allWindowsInReverse = [[GREYUIWindowProvider allWindowsWithStatusBar:includeStatusBar] reverseObjectEnumerator]; - CGFloat maxLevel = [GREYKeyboard isKeyboardVisible] ? 1 : 0; for (UIWindow *window in allWindowsInReverse) { - if (window.hidden || window.alpha == 0 || - (iOS17_OR_ABOVE() && [window respondsToSelector:@selector(windowLevel)] && - window.windowLevel > maxLevel)) { + if (window.hidden || window.alpha == 0) { continue; } [self drawViewInContext:bitmapContextRef