Open Bug 1875669 Opened 6 months ago Updated 14 days ago

Wrong resolution on external display (DeX)

Categories

(Fenix :: Browser Engine, defect)

Firefox 121
All
Android
defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: elidoset, Unassigned)

References

Details

Attachments

(1 file)

Steps to reproduce:

I use Samsung DeX on an external monitor, which doesn't have the same resolution as my device (Samsung Tab S8).

Actual results:

All websites render way too big for the size of the screen. Upon further investigation, it appears that Firefox is reporting the wrong display size and DPI settings to the webview. Chrome is behaving correctly.
As proof, see attached screenshot of the website https://whatismyviewport.com/ loaded on both Fenix and Chrome side to side.

Expected results:

Firefox and Android should both report the same display size (1920x1080, DPI=1) on my external monitor

I'm currently investigating both codebases to try and find where this is handled on both browsers, I could maybe pinpoint the exact issue, but I'm not familiar with either codebases and it might take me a while, so I'm posting this now in case anyone else has a better idea than me where to search.

As a first investigation, I may have found a first potential cause.
See : https://searchfox.org/mozilla-central/rev/85679f95a634d08307e115fb365ea287198bd4d2/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java#1433

The default display is used as an argument to create the Window Context, when it should actually be the current display. This might not be needed, as the Context provides an overrides which fetches the correct display if I understand correctly (https://developer.android.com/reference/android/content/Context.html#createWindowContext(int,%20android.os.Bundle).

Also it seems that querying the WINDOW_SERVICE instead of the DISPLAY_SERVICE may be preferred because it seems to be display-aware (and furthermore that's the way Chromium does it, from what I've understood)

I'm not able to confirm any of these claims unfortunately, as I do not currently have access to the tooling necessary to compile Fenix. I hope this proves itself useful to someone however.

The severity field is not set for this bug.
:amejia, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(amejiamarmol)
Severity: -- → S3
Flags: needinfo?(amejiamarmol)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: