Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Touchpad scrolling in GTK apps is not kinetic/inertial #1468

Closed
valpackett opened this issue Jan 15, 2019 · 2 comments
Closed

Touchpad scrolling in GTK apps is not kinetic/inertial #1468

valpackett opened this issue Jan 15, 2019 · 2 comments
Labels

Comments

@valpackett
Copy link
Contributor

I can't believe there's no issue for this yet..

And I just found the culprit: GTK doesn't do the kinetic thing if you send a wl_pointer.frame in between the wl_pointer.axis_stops!!

Silly workaround:

--- i/types/seat/wlr_seat_pointer.c
+++ w/types/seat/wlr_seat_pointer.c
@@ -264,10 +264,12 @@ void wlr_seat_pointer_send_axis(struct wlr_seat *wlr_seat, uint32_t time,
 
 			wl_pointer_send_axis(resource, time, orientation,
 				wl_fixed_from_double(value));
+			pointer_send_frame(resource);
 		} else if (version >= WL_POINTER_AXIS_STOP_SINCE_VERSION) {
 			wl_pointer_send_axis_stop(resource, time, orientation);
+			if (orientation > 0)
+				pointer_send_frame(resource);
 		}
-		pointer_send_frame(resource);
 	}
 }

I'm not sure what would be the "beautiful" code to solve this. Weston just explicitly handles horizontal and vertical in the same function instead of having an orientation parameter.

@emersion
Copy link
Member

emersion commented Jan 15, 2019

wl_pointer.frame handling should be reworked. Maybe we could use an idle event source to send the event after all other pointer events?

@emersion emersion added the bug label Jan 15, 2019
@emersion
Copy link
Member

Anyway, thanks for finding this, it's helpful. :)

emersion added a commit to emersion/wlroots that referenced this issue Jan 26, 2019
Frame events group logically connected pointer events. It makes sense to make
the backend responsible for sending frame events, since once the events are
split (ie. once the frame events are stripped) it's not easy to figure out
which events belongs to which frame again.

This is also how Weston handles frame events.

Fixes swaywm#1468
ddevault pushed a commit to swaywm/rootston that referenced this issue Aug 8, 2019
Frame events group logically connected pointer events. It makes sense to make
the backend responsible for sending frame events, since once the events are
split (ie. once the frame events are stripped) it's not easy to figure out
which events belongs to which frame again.

This is also how Weston handles frame events.

Fixes swaywm/wlroots#1468
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants