Closed Bug 981699 Opened 10 years ago Closed 10 years ago

Windows jump around when being restored if they have a size and are maximized

Categories

(Firefox :: Session Restore, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
Firefox 31
Tracking Status
firefox31 --- verified

People

(Reporter: ttaubert, Assigned: ttaubert)

Details

Attachments

(1 file)

The initial window of my nightly session jumps around when starting up Firefox because (probably) OS X opens a maximized window, we then go and all window.resizeTo() only to call window.maximize() shortly after.

We should really omit the resizeTo() call for a currently maximized window that will end up maximized again.
OMG this is that bug!?
Yeah... I couldn't find a regression range for this (builds from last year have the same behavior) but I also don't remember when this started happening.
Comment on attachment 8388602 [details] [diff] [review]
0001-Bug-981699-Skip-resizeTo-call-when-restoring-a-maxim.patch

Review of attachment 8388602 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM

::: browser/components/sessionstore/src/SessionStore.jsm
@@ +2783,5 @@
>      if (aWidth && aHeight && (aWidth != win_("width") || aHeight != win_("height"))) {
> +      // Don't resize the window if it's currently maximized and we would
> +      // maximize it again shortly after.
> +      if (aSizeMode != "maximized" || win_("sizemode") != "maximized") {
> +        aWindow.resizeTo(aWidth, aHeight);

With this if a user "un-maximizes" the window, it won't return to the proper pre-maximize dimensions (only in the case where we start with a maximized window right?). I don't think we really need to care about that though, so I'm fine if we don't handle it.
Attachment #8388602 - Flags: review?(smacleod) → review+
(In reply to Steven MacLeod [:smacleod] from comment #4)
> With this if a user "un-maximizes" the window, it won't return to the proper
> pre-maximize dimensions (only in the case where we start with a maximized
> window right?). I don't think we really need to care about that though, so
> I'm fine if we don't handle it.

Yes, that's true. I noticed that as well while working on the patch but I think that's less pain than having windows jump around... At least on Mac it doesn't even work right nowadays when restoring a closed window. It however works on Linux where we would still support it for all restored windows other than the initial one.
https://hg.mozilla.org/mozilla-central/rev/c65a149ccb6a
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 31
Keywords: verifyme
Tim, does this need tests?
Flags: in-testsuite?
Verified fixed on Mac OS 10.9.3, Windows 7 64bit and Ubuntu 13.10 32bit using Firefox 31.0 RC (buildID: 	20140714151536).
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: