Conversation

currently my biggest gripe with Linux on mobile is scaling. touchscreen gestures are broken in all wayland compositors, they divide the touch coordinates by the scale factor to process them and somewhere the fractional component gets lost.

if you've ever scrolled down a webpage side by side on a device running phosh and an Android device and thought "damn the Linux phone just feels worse" its because it can only scroll in 2 or 3 pixel increments.

fixing this would improve UX more than any other single change right now imo

4
3
1
@cas It may be more than that. I'm pretty sure that resolution of the touchscreen does not have to be equal to resolution of the display...
1
0
0

@whynothugo i think its a protocol issue, not 100% sure though

1
0
0

@cas this sounds like a long tracing session (to find out where that drop off is happening at).

Since you mentioned a webpage - would even a gtkwebview demo app be enough to replicate this?

(Looks at his pinephone)

2
0
0

@jalcine it happens everywhere, even in waydroid for example, at least on Phosh but I dont think its specific to Phosh.

it happens in the compositor (pulling down the notifications), in gtk4, everywhere....

0
0
0

@jalcine @cas

scrolling with WebkitWebView is done internally to WebKit and doesn't use GTK's scrolling or kinetic acceleration infrastructure. So for a web view at least, you'll have to look in WebKit.

For GtkTextView, I can't fix it until I can break ABI. I need to make gtk_text_view_get_visible_rect() use doubles in GTK 5.

I have some patches for VTE but they need work.

Otherwise, it's usually the GtkAdjustment for custom scrollables.

1
0
0

@hergertme @jalcine I think its lower level than that, it seems to be global

0
0
0

@pavel well thats a whole other kettle of fish (and definitely not the case here, see the videos i posted when i first found this bug https://gitlab.gnome.org/World/Phosh/phoc/-/issues/293)

1
0
1

@cas Reading the details for https://wayland.app/protocols/wayland#wl_pointer:event:motion, I think it is a protocol limitation; the coordinates of the touch events are relative to surface coordinates. So if the surface is 700x500 with a 3x scale, you can only represent 700x500 points in total, whereas you have 2100x1500 pixels on screen.

1
0
0
@whynothugo @cas I'm playing with wev on Pinephone on Sxmo (Sway). The touch x and y coordinates seems to get scaled correctly as floats when the scale value increase. Yes, they are relative to the surface dimensions, which means x2 scale divide the touch pos by 2. But the precision seems to remains the same. I don't think that is the cause of this "step" feeling while scrolling.
Maybe all application took the wrong assumptions that the coordinate represent pixels, and forget about the floating point precision?
Maybe all application apply the scale value while scrolling to keep the same available velocity?
Also, is Posh implement fractional-scale-v1? If some rounding is actually applied somewhere, maybe this will help when supported. (irrelevant for this ticket example with a x4 value)
1
0
0

@stacyharper @whynothugo yeah I'm confused about this because as you said the fractional part should be there. But I'm able to notice stepping in every single wayland app...

0
0
0

@cas @pavel That one is simple: the layer surface coordinates get multiplied by the scale. I've linked a PoC MR in case someone with interest in HiDPI wants a fun time and polish it. There's more low hanging improvements to avoid the initial jump when the gesture gets picked up.

0
1
0

Popolon ๐Ÿ‡ต๐Ÿ‡ธ๐Ÿ‡ณ๐Ÿ‡จโ˜ฎ๏ธ๐ŸŒณ๐ŸŽ‹ แ ซแ ฃแ ซแ ฃแ ฏแ ฃแ จ๐ŸŽๆŠฑๆŠฑ้พ™๐Ÿ‰ โšฯ†

Edited 10 months ago

@cas I still don't understand why some thought that would be a good idea to made a ร—2 zoom by default :(. Working on a theme with bigger font and widget size would be a far better solution in my point of view. I encountered lot of problems due to this. Including some applications that go out of screen (due to the real (vs virtual) screen size, where they would have just worked fine without it. This mean have all application reworked to be perfectly usable instead of most application working nicely.

Another point I don't understand, is, as a user of a Pinephone Pro, there is after my test with Lร–VE dev kit (at least) 5 points/finger management. but it looks like Phosh interface) has no multitouch management by default. But the GTK+demo (one of defaults tools of GTK) manage it in a view, in at least one demo, this would have simplified a lot navigating in too large windows. (2 fingers for viewport, 3 fingers for window could be use in some case perhaps?)

1
0
0

@popolon the problem is using a scale factor at all. The correct:tm: way to build a UI is to use physical units NOT pixels.

Just increasing the font size or whatever is useless, you need a toolkit which is not designed badly

0
0
0

@cas I feel like that also affected my attempts to calibrate an LCD drawing tablet under Linux not long ago, I was always getting really strangely crunchy results. What was weird was when I switched to a non-LCD tablet for input with the default absolute mode scaling, whatever that is, it all worked smoothly. I dunno.

1
0
0

@vxo if you have a scale factor set and are using GTK/GNOME then this could definitely be the cause.

0
0
0