Closed Bug 859266 Opened 8 years ago Closed 8 years ago
[win-hidpi] fullscreen window incorrectly sized with custom dev
Pixels Per Px value
Since bug 824386 landed, fullscreen windows are handled correctly with default settings (layout.css.devPixelsPerPx = -1.0, i.e. respect system settings). However, if the user sets a custom devPixelsPerPx value, fullscreen mode (F11) does not work correctly - the window will be too small if devPixelsPerPx is 1.0 but the system scaling is 125% or 150%, for example, and too large if devPixelsPerPx is increased beyond the system value. This is because widget/windows/nsWindow.cpp respects the custom devPixelsPerPx value when positioning/sizing windows, but nsScreenWin.cpp relies on the system value when determining the available size of the screen(s). It's possible to fix this by handling the discrepancy in nsBaseWidget::MakeFullScreen, by comparing GetDefaultScale() with the value returned by GetDefaultScaleInternal() and using the ratio (if different) as a correction factor. However, I think it's cleaner to fix it by making nsScreenWin respect the devPixelsPerPx preference in the same way as nsWindow, so that the two will always agree about coordinates. (Users who don't mess with about:config settings will never see the problem, of course, as the default is for GetDefaultScale to return the system value so everything agrees anyway. But unless/until we're prepared to completely remove the devPixelsPerPx override, we should fix the issue here.)
Patch to make nsScreenWin etc respect the scaling pref. AFAICT, this makes fullscreen mode, window-position constraints, etc work properly for both default and custom devPixelsPerPx settings. Tryserver build: https://tbpl.mozilla.org/?tree=Try&rev=81f720a0e30d
Attachment #734551 - Flags: review?(roc)
Attachment #734551 - Flags: review?(roc) → review+
Target Milestone: --- → mozilla23
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Comment on attachment 734551 [details] [diff] [review] patch, convert nsScreenWin etc to respect devPixelsPerPx setting [Approval Request Comment] Bug caused by (feature/regressing bug #): win-hidpi support User impact if declined: incorrectly-sized "fullscreen" window for users who set custom devPixelsPerPx value different from the system-level scaling Testing completed (on m-c, etc.): in Nightly Risk to taking this patch (and alternatives if risky): low risk - no impact for users with default prefs String or IDL/UUID changes made by this patch: none
Attachment #734551 - Flags: approval-mozilla-aurora?
Comment on attachment 734551 [details] [diff] [review] patch, convert nsScreenWin etc to respect devPixelsPerPx setting We won't track for release since this is nonstandard, but it seems worth the uplift.
Attachment #734551 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
mass remove verifyme requests greater than 4 months old
You need to log in before you can comment on or make changes to this bug.