Commit b352a52d authored by David Jean's avatar David Jean Committed by Commit Bot

[ios] Fixed Multi-Window size issue on iPhone landscape

In MW mode, when on iPhones which isn't MW, the frame for a
window is set multiple times by iOS private methods, but some
of those do not take into account screen rotation and can end up
passing in a frame that is in portrait sizes on a landscape device.
When that happens, the frame is centered, hence the origin
contains a negative coordinate.  This CL skips setting the
frame on the ChromeOverlayWindow's parent when it has a negative
x (or y, in case the bug can be reproduced the inverse way).
It applies to iOS 13 and 14.

Bug: 1113187
Change-Id: I38b9f9f475502d5123ab381dbde01296416b22d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2359137
Commit-Queue: David Jean <djean@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799037}
parent f31a7de2
......@@ -71,6 +71,19 @@
self.traitCollection.userInterfaceStyle);
}
- (void)setFrame:(CGRect)rect {
if (@available(iOS 13, *)) {
if (!IsIPadIdiom() && (rect.origin.x < 0 || rect.origin.y < 0)) {
// skip, this rect is wrong and probably in portrait while
// display is in landscape.
} else {
[super setFrame:rect];
}
} else {
[super setFrame:rect];
}
}
#pragma mark - UITraitEnvironment
- (void)traitCollectionDidChange:(UITraitCollection*)previousTraitCollection {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment