Bug 1854820: Make the transition to window normal state work the same on extension windows as it does elsewhere. r=extension-reviewers,robwu

Calling window.restore will return the window to its previous
dimensions. Prior to this patch, extension windows transitioning to
normal state would add a second step where they would forcibly resize
the window to content. The motivating reason for this additional step is
some kind of difficulty with macOS windows restoring from other states.
Those issues were handled comprehensively in Bug 1631735, and now the
extra step is unnecessary and surprising to users. Since the call was
being made potentially during a deminimization native transition, the
window is at a very small size and expanding it to fit the content is
resizing it to a strange small size. Window.restore will do the right
thing, so this patch stops calling sizeToContent.

Differential Revision: https://phabricator.services.mozilla.com/D189972
This commit is contained in:
Brad Werth
2023-11-18 00:30:52 +00:00
parent a010588258
commit f934e9176d

View File

@@ -1043,11 +1043,6 @@ class Window extends WindowBase {
if (window.windowState !== window.STATE_NORMAL) {
window.restore();
}
if (window.windowState !== window.STATE_NORMAL) {
// And on OS-X, where normal vs. maximized is basically a heuristic,
// we need to cheat.
window.sizeToContent();
}
break;
case window.STATE_FULLSCREEN: