Display scaling 150% causes Firefox and Chrome to return window.devicePixelRatio = 2

Bug #1895164 reported by Daniel Cheung
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gtk+3.0 (Ubuntu)
New
Low
Unassigned
mutter (Ubuntu)
New
Low
Unassigned

Bug Description

## Steps to reproduce

1. Use Ubuntu 20.04 with an Nvidia graphics card with GNOME Desktop.
2. Set display scaling to any fractional value (150%)
3. open up Firefox/Chrome/Chromium. Open up Console and type `window.devicePixelRatio`

## What happened

I received 2

## What should have happened

I should have gotten 1.5

---

I reported this bug here instead of in Firefox/Chrome because they both report the same value only on Linux. They correctly report 1.5 on Windows, which I believe may be an issue with GNOME.

Revision history for this message
Daniel Cheung (daniel-2345) wrote :

$ printf 'Desktop: %s\nSession: %s\n' "$XDG_CURRENT_DESKTOP" "$GDMSESSION"
Desktop: ubuntu:GNOME
Session: ubuntu

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

It's possible the problem is actually GTK (which sits between Mutter and the apps) only supporting integer scales.

tags: added: focal
tags: added: xrandr-scaling
Changed in gtk+3.0 (Ubuntu):
importance: Undecided → Low
Changed in mutter (Ubuntu):
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.