Skip to content
Myr

wayland: scale x,y in touch events

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Closes #686

authored by Daniel Eklöf · committed by Daniel Eklöf · parent ce5dd7f · Browse files · 2 files+14 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+14 added−7 removed

  • other:+14 added−7 removed

2 files+14 added−7 removed

modified:CHANGELOG.md+3 added
56 unmodified lines
57 (e.g. `\tsecond column`, or `first\t\tthird`) ([#658][658])58* Regression: `--accept-nth=0` and `--with-nth=0` not being treated as59 if not specified at all ([#670][670]).60* Improved scrolling with mouse wheel and touchpad ([#673][673]).61* Incorrect touch coordinates with desktop scaling enabled62 ([#686][686]).6364[658]: https://codeberg.org/dnkl/fuzzel/issues/65865[670]: https://codeberg.org/dnkl/fuzzel/issues/67066[673]: https://codeberg.org/dnkl/fuzzel/issues/67367[686]: https://codeberg.org/dnkl/fuzzel/issues/686686970### Security71### Contributors
1048 unmodified lines
modified:wayland.c+11 added-7 removed
1350 unmodified lines
1351 /* Only track one touch at a time */1352 if (seat->touch.active_touch.scrolling)1353 return;13541355 const float scale = seat->wayl->scale;13561357 seat->touch.active_touch.id = id;1356 seat->touch.active_touch.start_x = wl_fixed_to_double(x);1357 seat->touch.active_touch.start_y = wl_fixed_to_double(y);1358 seat->touch.active_touch.current_x = wl_fixed_to_double(x);1359 seat->touch.active_touch.current_y = wl_fixed_to_double(y);1360 seat->touch.active_touch.last_y = wl_fixed_to_double(y);1358 seat->touch.active_touch.start_x = round(wl_fixed_to_double(x) * scale);1359 seat->touch.active_touch.start_y = round(wl_fixed_to_double(y) * scale);1360 seat->touch.active_touch.current_x = round(wl_fixed_to_double(x) * scale);1361 seat->touch.active_touch.current_y = round(wl_fixed_to_double(y) * scale);1362 seat->touch.active_touch.last_y = round(wl_fixed_to_double(y) * scale);1363 seat->touch.active_touch.scrolling = true;1364 seat->touch.active_touch.is_tap = true;1365 seat->touch.active_touch.start_time = time;1366 seat->touch.active_touch.accumulated_scroll = 0.0;
44 unmodified lines
14111412 if (!seat->touch.active_touch.scrolling || seat->touch.active_touch.id != id)1413 return;14141413 double new_x = wl_fixed_to_double(x);1414 double new_y = wl_fixed_to_double(y);1415 const float scale = seat->wayl->scale;14161417 double new_x = round(wl_fixed_to_double(x) * scale);1418 double new_y = round(wl_fixed_to_double(y) * scale);14191420 /* Update current position */1421 seat->touch.active_touch.current_x = new_x;1422 seat->touch.active_touch.current_y = new_y;1423
1753 unmodified lines