Closed Bug 1259492 Opened 5 years ago Closed 5 years ago
window may be re-opened off-screen if monitor configuration has been changed since position was persisted
STR, on Windows 8.1 (or presumably Win10) with two displays: * Arrange displays in the Display control panel with the secondary monitor to the right of the primary one * Sign out of Windows, and sign in again (to ensure its state is fully updated for the monitor arrangement) * Launch Nightly, and put its window on the secondary monitor * Quit Nightly * Rearrange displays to put the secondary monitor on the left of the primary one * Re-launch Nightly Expected: The new Nightly window should be visible on-screen Actual: It's invisible, although it shows up in the taskbar as being open (Actually, it probably has a one-pixel wide sliver visible on the right-hand edge of the main screen, but that's pretty hard to see.)
This occurs because at the point where nsXULWindow::OnChromeLoaded calls LoadPositionFromXUL, which uses nsWindow::ConstrainPosition to ensure it is on-screen, the window widget has not yet been given a useful size. So we end up ensuring that its top-left pixel is on-screen, but that's all. (Chances are this can happen on other platforms, too, unless their windowing toolkits are more aggressive about ensuring windows remain visible.)
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Attachment #8734420 - Flags: review?(VYV03354) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/8ef8befd63b90b867ae27ab1b58758180dad0fc3 Bug 1259492 - Ensure window position is constrained to the screen after it has been sized properly in nsXULWindow::OnChromeLoaded. r=emk
Comment on attachment 8734420 [details] [diff] [review] Ensure window position is constrained to the screen after it has been sized properly in nsXULWindow::OnChromeLoaded Approval Request Comment [Feature/regressing bug #]: 890156 [User impact if declined]: When re-opening Firefox after rearranging the monitor configuration, the window may not be properly constrained to the visible screen area [Describe test coverage new/current, TreeHerder]: manual [Risks and why]: minimal, just another small tweak to window placement (to ensure we always re-check position after size is known) [String/UUID change made/needed]: none
Attachment #8734420 - Flags: approval-mozilla-aurora?
Comment on attachment 8734420 [details] [diff] [review] Ensure window position is constrained to the screen after it has been sized properly in nsXULWindow::OnChromeLoaded related to per-monitor DPI support, Aurora47+
Attachment #8734420 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
This got uplifted earlier today in https://hg.mozilla.org/releases/mozilla-aurora/rev/8e9a6e6cbacd
Reproduced the initial issue using old Nightly from (2016-03-24), verified that the issue is fixed using latest Developer Edition 48.0a2 and Firefox 47 beta 8.
Moving to Core:XUL per https://bugzilla.mozilla.org/show_bug.cgi?id=1455336
Component: XP Toolkit/Widgets: XUL → XUL
You need to log in before you can comment on or make changes to this bug.