Consider using any-pointer media feature to set 'Density' to 'Touch' by default

NEW
Unassigned

Status

()

enhancement
P3
normal
8 months ago
8 months ago

People

(Reporter: hiro, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Reporter

Description

8 months ago
I am pretty sure that the 'Density: Touch' corresponds to `!matchMedia('(any-pointer: fine)').matches`.  (We might also want to check 'any-pointer: none))

Now the feature has landed in mozilla-central (bug 1483111), we can use it.
We do something similar for Windows 10 in Tablet mode,
https://searchfox.org/mozilla-central/rev/bdc89dfd7869e418d788b28eb60ab8d94e708a15/browser/base/content/browser.js#5848-5856

We could probably add something to that function to also bump up to Touch density if there are no fine pointing devices available.
Priority: -- → P3

Comment 2

8 months ago
It's not clear to me how we'd mix this with user choice. That is, the user should ultimately control the density setting. Users on machines with pointing devices may still want to use touch density, and users on machines without may still want to use normal/compact density (e.g. because they use the keyboard or a11y input devices instead). That's on top of the fact that some devices may gain/lose pointing devices dynamically (e.g. my surface pro would, when I attach/detach the keyboard cover which has a touchpad).

We effectively need a "moving default", but we don't have preferences infrastructure for this.

I'm leaning towards wontfix, because I can't see a way of doing this cleanly and making user-understandable UI, and the benefits seem pretty slim to me.

::dao, do you have suggestions/thoughts here?
Flags: needinfo?(dao+bmo)
(In reply to :Gijs (he/him) from comment #2)
> It's not clear to me how we'd mix this with user choice. That is, the user
> should ultimately control the density setting. Users on machines with
> pointing devices may still want to use touch density, and users on machines
> without may still want to use normal/compact density (e.g. because they use
> the keyboard or a11y input devices instead). That's on top of the fact that
> some devices may gain/lose pointing devices dynamically (e.g. my surface pro
> would, when I attach/detach the keyboard cover which has a touchpad).
> 
> We effectively need a "moving default", but we don't have preferences
> infrastructure for this.
> 
> I'm leaning towards wontfix, because I can't see a way of doing this cleanly
> and making user-understandable UI, and the benefits seem pretty slim to me.

This seems like an already-solved problem given the browser.touchmode.auto pref.

(In reply to Hiroyuki Ikezoe (:hiro) from comment #0)
> I am pretty sure that the 'Density: Touch' corresponds to
> `!matchMedia('(any-pointer: fine)').matches`.  (We might also want to check
> 'any-pointer: none))
> 
> Now the feature has landed in mozilla-central (bug 1483111), we can use it.

We used to automatically adjust the UI on Windows based on the -moz-touch-enabled media query. We had to revert this because the presence of a touch screen doesn't mean that the user is actually using it. Are those new queries different in that regard?
Flags: needinfo?(dao+bmo)
You need to log in before you can comment on or make changes to this bug.