Window position not restored correctly on start (moved by 8px) when Session Restore is disabled
Categories
(Core :: Widget: Win32, defect, P3)
Tracking
()
People
(Reporter: the.recliner, Assigned: emk)
References
Details
Attachments
(1 file, 1 obsolete file)
21.02 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0
Steps to reproduce:
- Open Firefox (new installation, fresh profile).
- Change the window size/position (without maximizing) and place the window at the leftmost of the screen (x=0).
- Close Firefox (File > Quit, or the window's "X" button).
- Open Firefox again (same profile).
Actual results:
The window is shifted by 8px to the right exactly. The width/height of the window are preserved, it only gets moved to the right.
The data in "xulstorage.json" when the window is closed at the leftmost:
[...]
"screenX": "-8",
"screenY": "0",
[...]
Once you re-open and close Firefox without moving it (after it was shifted on start):
[...]
"screenX": "0",
"screenY": "0",
[...]
The measured distance is effectively 8px as shown in the attached screenshots.
Expected results:
The window should have been restored exactly where it was before closing.
If I close Firefox and the window is on the rightmost of the screen Firefox shifts its window to the left by 8px exactly too.
If I manually set the window to the whole width of the screen (not with the maximize button), the window is shifted 8px to the right with a part of the window out of the bound of the screen.
If the window is not on the leftmost or rightmost, the position is restored correctly/precisely.
If the window is maximized, it is restored correctly (in its maximized state).
I have checked this behavior with other applications (Chrome, Discord, Microsoft Outlook/Word/Excel) and they all restore their size/position correctly, no shifting.
I have tried deleting xulstorage.json but the issue is still present, and it also happen on a fresh install/profile of Firefox (and Windows).
Tested on Firefox version: 83.0, Fresh Install and Profile
OS: Windows 10 20H2 (19042.685), Fresh Install, Default Display/Window Settings (Also tested on Windows Server 2016, same behavior).
Comment 1•5 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Reporter | ||
Updated•5 years ago
|
Comment 2•4 years ago
|
||
I can confirm this with Firefox 87 in Windows 10.
The Window position and state is usually never restored correctly.
Assignee | ||
Comment 3•4 years ago
|
||
Looks like this is intentional:
https://searchfox.org/mozilla-central/rev/1758450798ae14492ba28b695f48143840ad6c5b/browser/components/sessionstore/SessionStore.jsm#4849-4863
"screenX": "-8",
This is because non-maximized window has a transparent border around the visible border on Windows 10.
Assignee | ||
Comment 4•4 years ago
|
||
Bug 1276516 is not a regressor, rather it should have fixed this.
Assignee | ||
Comment 5•4 years ago
|
||
I could not reproduce the bug...
Assignee | ||
Comment 6•4 years ago
|
||
This bug depends on the session restore setting (App menu > Options > General > Startup > Restore previous session).
If the session restore is enabled, the window will show at the wrong (shifted) position at first, then it will move to the correct (slightly off-screen) position. If the session restore is disabled, the window will stay at the wrong position.
Assignee | ||
Comment 7•4 years ago
•
|
||
I think ConstrainPosition
will set the wrong initial position because the aAllowSlop
argument is false:
https://searchfox.org/mozilla-central/rev/6c9ff2820d3aae683ec87c53c79e5108d54f3f76/xpfe/appshell/AppWindow.cpp#1307
Assignee | ||
Comment 8•4 years ago
|
||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Comment 10•4 years ago
|
||
bugherder |
Assignee | ||
Updated•4 years ago
|
Comment 11•4 years ago
|
||
Backed out for putting browser window partially behind left and top taskbars on older Windows versions (bug 1705504)
backout: https://hg.mozilla.org/integration/autoland/rev/09908d752facc9c5ec5ddcc2e6fa33895a30070f
Comment 12•4 years ago
|
||
Backout merged to central: https://hg.mozilla.org/mozilla-central/rev/09908d752facc9c5ec5ddcc2e6fa33895a30070f
![]() |
||
Comment 13•3 years ago
|
||
This got fixed by 1753836 - at least on my end. Please reopen the bug or comment if you can still reproduce the issue in the latest Nightly.
Assignee | ||
Comment 14•3 years ago
|
||
I can still reproduce this bug. Please make sure that Session Restore is disabled (as I wrote in comment #6).
Updating the title to clarify.
Comment 15•3 years ago
|
||
There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:emk, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit auto_nag documentation.
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Comment hidden (off-topic) |
Comment 17•3 years ago
|
||
Sorry, there was a problem with the detection of inactive users. I'm reverting the change.
Updated•3 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Description
•