Closed Bug 1259492 Opened 8 years ago Closed 8 years ago

window may be re-opened off-screen if monitor configuration has been changed since position was persisted

Categories

(Core :: XUL, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla48
Tracking Status
firefox46 --- unaffected
firefox47 --- verified
firefox48 --- verified

People

(Reporter: jfkthame, Assigned: jfkthame)

References

Details

Attachments

(1 file)

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?
Blocks: 1259707
https://hg.mozilla.org/mozilla-central/rev/8ef8befd63b9
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
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+
Flags: qe-verify+
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.
Status: RESOLVED → VERIFIED
Flags: qe-verify+
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.