Firefox window does not recognize that it is on a different monitor when resuming from suspend.

RESOLVED FIXED in Firefox 47

Status

()

Core
Widget: Win32
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: aklotz, Assigned: jfkthame)

Tracking

Trunk
mozilla48
Unspecified
Windows
Points:
---

Firefox Tracking Flags

(firefox47 fixed, firefox48 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
Here's what happened, I am unsure as to how reproducible this is as I am currently traveling. Probably easily:

Hardware setup: Macbook Pro Retina with Windows 10 bootcamp, external Dell U2413 hooked up.

1. Have a Firefox window maximized on the external monitor.
2. Suspend the laptop.
3. Unplug the external monitor.
4. Resume the laptop.

Expected: Maximized Firefox window is correctly sized on the Retina display.
Actual: Dimensions of window result in all window chrome being located off-screen.

I ran Spy++ and it showed the Window's coordinates as (-964, -606), (1924, 1166), size is 2888x1772.
(Assignee)

Comment 1

2 years ago
What version (build), exactly? There have been some recent fixes that may be relevant here; please re-test with latest Nightly, and confirm whether the problem still occurs. Thanks.
Flags: needinfo?(aklotz)
(This may be a windows 10 problem, very similar problem sometimes happens to me e.g. with media players like VLC)
(Assignee)

Comment 3

2 years ago
OK, I can reproduce this on Win8.1 with latest Nightly. When it happens, you can "fix" the window by minimizing and re-maximizing it -- i.e. click the taskbar icon a couple of times -- but it's a pretty ugly user experience. Should be fixable.... I'll take a look.
Flags: needinfo?(aklotz)
(Assignee)

Comment 4

2 years ago
FTR, I can reproduce similar issues without suspend/resume, by just unplugging my external display while the Nightly window is maximized on it. The screen blanks momentarily as Windows reconsiders its position, then comes back -- with the Nightly window oversized and misplaced, not correctly constrained to the new screen bounds.
(Assignee)

Comment 5

2 years ago
Created attachment 8730874 [details] [diff] [review]
Don't attempt to resize a maximized window on DPI change; and when handling a DPI change, constrain the resized window to the screen bounds

Restricting the resize in OnDPIChanged to windows in the 'normal' state fixes the reported problem here. There's also a related issue if the window is not maximized on the external monitor, but is large enough that when it gets resumed on the internal screen (and resized according to the DPI change), it's too big to fit. To avoid that, this patch also adds a check on the new position and size.
Attachment #8730874 - Flags: review?(VYV03354)
(Assignee)

Updated

2 years ago
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Attachment #8730874 - Flags: review?(VYV03354) → review+
(Assignee)

Comment 7

2 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/1c2aac5e9b1cec93623a724b86493093365e5678
Bug 1254019 - Don't attempt to resize a maximized window on DPI change; and when handling a DPI change, constrain the resized window to the screen bounds. r=emk
(Assignee)

Updated

2 years ago
See Also: → bug 1257071
(Assignee)

Comment 8

2 years ago
Comment on attachment 8730874 [details] [diff] [review]
Don't attempt to resize a maximized window on DPI change; and when handling a DPI change, constrain the resized window to the screen bounds

Approval Request Comment
[Feature/regressing bug #]: 890156 (per-monitor dpi)

[User impact if declined]: possibility of bad UX with mis-scaled window contents when the display configuration changes dynamically (e.g. unplugging a second monitor with different DPI)

[Describe test coverage new/current, TreeHerder]: tested manually; not testable in automation as it involves dynamically changing the system (hardware) configuration

[Risks and why]: minimal risk, just adding precautionary checks within the DPI-change handling on Windows (so cannot affect any other situation or platform)

[String/UUID change made/needed]: none
Attachment #8730874 - Flags: approval-mozilla-aurora?
Hi,

backed this out in  https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&revision=7c210149e23c since one of the changes caused reftest failures like :

https://treeherder.mozilla.org/logviewer.html#?job_id=23888478&repo=mozilla-inbound
Flags: needinfo?(jfkthame)
(Assignee)

Comment 11

2 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/1a5cb1ac5a7c4f7f38bf32013dc0da4712eea186
Bug 1254019 - Don't attempt to resize a maximized window on DPI change; and when handling a DPI change, constrain the resized window to the screen bounds. r=emk
(Assignee)

Comment 12

2 years ago
(In reply to Carsten Book [:Tomcat] from comment #9)
> Hi,
> 
> backed this out in 
> https://treeherder.mozilla.org/#/jobs?repo=mozilla-
> inbound&revision=7c210149e23c since one of the changes caused reftest
> failures like :
> 
> https://treeherder.mozilla.org/logviewer.html#?job_id=23888478&repo=mozilla-
> inbound

That was bug 1255158 (unrelated, but pushed at the same time), so I've re-landed this one.
Flags: needinfo?(jfkthame)
Comment on attachment 8730874 [details] [diff] [review]
Don't attempt to resize a maximized window on DPI change; and when handling a DPI change, constrain the resized window to the screen bounds

Trying to improve multi-mon drag-drop-resize experience, Aurora47+
Attachment #8730874 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+

Comment 14

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/1a5cb1ac5a7c
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
status-firefox48: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48

Comment 15

2 years ago
bugherderuplift
https://hg.mozilla.org/releases/mozilla-aurora/rev/112cb0b69503
status-firefox47: affected → fixed
You need to log in before you can comment on or make changes to this bug.